/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui;

import engine.ani.Player;
import engine.goods.Goods;
import engine.net.NetManager;
import engine.skill.SkillManager;
import function.GameSet;
import function.Property;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.TextField;
import javax.microedition.lcdui.game.GameCanvas;

import mainpackage.Constant;
import mainpackage.GameBean;
import mainpackage.InputInterFace;
import mainpackage.MainCanvas;
import mainpackage.MainGame;
import mainpackage.MainLogic;
import mainpackage.MainView;
import mainpackage.ResManager;
import mainpackage.Rms;

//#if NOKIAN73 || NOKIA_S40V3 || MOT0 || K790
//# 
//#else
import mainpackage.SoundPlayerUtil;
//#endif
import mainpackage.Tools;

/**
 *
 * @author foonwayx
 */
public class UiEquipment {
    //ui界面的起始点坐标

    private int iPositionX = 0; //记录跑马灯位置
    private Image[] imgArray;
    public String[] sArray;
    private String sMarqueeString = null;
    public Goods items;//邮件附件中的装备
    public Goods emailItems;//邮件附件中的装备
    public Goods getemailItems;//收到的附件
    public byte byUiState = 0;
    private String[] chatArray;
    private String StrSelect;
    private String[] chatStrSelect;
    //表情
    private String[] simleArray;
    private String[] strSmile;
    private String[] strSmile1;
    private String[] chatSetArray;
    private String[] strSet;
    private String[] emailArray;
    private String[] receiveArray;
    private String[] operationArray;
    private String[] str1;
    private String[] str2;
    private String[] str3;
    private String[] str4;
    private String[] str5;
    private String[] viewEmailArray;
    private String[] meridianArray;
    private String[] mapArray;
    private String[] gamesetArray;
    public static int gameset_index;
    public static int set_index;
    //#if NOKIAN73 || NOKIA_S40V3  || NORMAL_240_400
//#     public static boolean[] isopenset = {
//#         false, true, true, true, true,//system
//#         true, true, true, true, true,//chat
//#         false, false, false, true, true, true, false, true, false, true, true, true, false//display
//#     };
    //#else
    public static boolean[] isopenset = new boolean[]{
        true, true, true, true, true,//system
        true, true, true, true, true,//chat
        true, true, true, true, true,//
        true, true, true, true, true,//
        true, true, true,//display
    };
    //#endif
    public static byte stateflow;
    public static byte flow;//流量设置

    public UiEquipment() {
    }

    public void init() {
        switch (MainLogic.getInstance().byGameState) {
            case Constant.GAME_UI_SKILL://心法
                skillindex = 0;
                sMarqueeString = "学习心法可以获得新的技能，技能可以通过设置快捷键位置选项设置快捷键。";
                Skill_operationTyte = 0;
                this.sArray = new String[]{"技能总览", "职业技能：", "心法技能：", "帮派技能：", "你确认删除心法", "确定", "取消", "当前级别：", "最高级别：", "精气消耗：", "CD时间：", "技能类别：", "主动", "被动"};
                //#if NOKIA_S60V5
                 try {
 //                    System.out.println("");
                     this.imgArray = new Image[12];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                     this.imgArray[8] = Goods.createGoodsBg((byte) 1);
                     this.imgArray[9] = ResManager.createImage(90000087);
 //                //半透明图0xff0000
                     this.imgArray[10] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xff0000);
                     //物品选择
                     this.imgArray[11] = ResManager.createImage(90000093);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                imgArray = new Image[10];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //格子背景图片
//#                    this.imgArray[3] = Goods.createGoodsBg((byte) 1);
//#                    //装备的图标
                    //#if NOKIA_E72
//#                     this.imgArray[4] = ResManager.createImage(90000060);
                    //#else
//#                    //确定返回
//#                    this.imgArray[4] = Tools.makeTransparent(ResManager.createImage(90000060), 255);
                    //#endif
//#                    //背景遮罩图
//#                    //圆角图片tishi2.png
//#                    this.imgArray[5] = ResManager.createImage(90000052);
//#                    this.imgArray[5] = Tools.makeTransparent(this.imgArray[5], -1);
//#                    this.imgArray[6] = ResManager.createImage(90000043);
//#                    //圆角图片tishi.png
//#                    this.imgArray[7] = ResManager.createImage(90000051);
//#                    this.imgArray[7] = Tools.makeTransparent(this.imgArray[7], -1);
//#                    //半透明图0xff0000
//#                    this.imgArray[8] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xff0000);
//#                    //物品选择
//#                    this.imgArray[9] = ResManager.createImage(90000093);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                break;
            case Constant.GAME_UI_CONNECTION_AGAIN:
                sArray = new String[]{"可能由于网络原", "因，需要重新连", "接服务。按确定", "重新连接，按", "返回退出到登", "陆界面。"};
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[8];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                imgArray = new Image[4];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //确定返回
//#                    this.imgArray[3] = ResManager.createImage(90000043);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                break;
            case Constant.GAME_UI_GAMESET:
                flow = stateflow;
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[8];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                imgArray = new Image[4];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
                    //#if NOKIA_E72
//#                     this.imgArray[3] = ResManager.createImage(90000060);
                    //#else
//#                    //确定返回
//#                    this.imgArray[3] = ResManager.createImage(90000043);
                    //#endif
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                sArray = new String[]{"系统", "聊天", "显示"};
                gameset_system = new String[]{
                    "游戏音乐",
                    "允许交易",//
                    "允许组队",//
                    "允许切磋",//
                    "游戏小地图",//4
                    "屏蔽玩家",//20
                    "玩家形象",//21
                    "闪屏震屏",//22
                    "流量设置",//
                };
                gameset_chat = new String[]{
                    "显示聊天框",//5
                    "显示区域聊天",//
                    "显示队伍聊天",//
                    "显示帮派聊天",//
                    "显示系统消息",//9
                };
                gameset_display = new String[]{
                    "他人光效",//
                    "自己光效",//
                    "宠物说话",//12
                    "玩家名字",//
                    "NPC名字",//
                    "显示宠物",//
                    "动态元素",//
                    "阴影效果",//
                    "天气效果",//18
                    "战斗数值",//
                };
                if (UiInterFace.SetPlayMusic) {
                    isopenset[0] = true;
                } else {
                    isopenset[0] = false;
                }
                gamesetArray = new String[]{"游戏设置", "系统", "开启", "关闭", "基本"};
                break;
            case Constant.GAME_UI_CHAT://聊天
            case Constant.GAME_UI_CHAT_SECOND:
            case Constant.GAME_UI_SMILE://表情
            case Constant.GAME_UI_CHAT_SET://聊天设置
//                System.out.println("tttttttttttttttttttttttttttttttttttttttttt");
                sMarqueeString = "选择频道后，按确定进入输入模式即可聊天。";

                imgArray = new Image[7];
                sArray = new String[]{"1综", "2世", "3区", "4私", "5队", "6帮", "7系"};
                simleArray = new String[]{"插入表情", "选择表情", "选择"};
                strSmile = new String[]{
                    "哭泣", "害羞", "无语",//
                    "真逗", "无奈", "所思",//
                    "生气", "惊呆", "骷髅",//
                    "难过", "高傲", "得意",//
                };
                strSmile1 = new String[]{
                    "1", "2", "3",//
                    "4", "5", "6",//
                    "7", "8", "9",//
                    "*", "0", "#",//
                };
                chatArray = new String[]{"聊天", "综合"};
                StrSelect = "请选择";
                chatStrSelect = new String[]{"1 悄悄话", "2 查看此人",
                    //                "3 切换频道", "4 聊天设置",
                    //                            "3 查看任务",
                    "3 查看物品", "4 加为好友", "5 邀请组队", "6 查看摊位"};
                chatSetArray = new String[]{"聊天设置", "确定", "开", "关", "返回"};
                strSet = new String[]{"[综合]", "[世界]", "[区域]", "[私聊]", "[队伍]", "[帮派]", "[系统]"};
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[9];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043); //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
 //                     表情
                     this.imgArray[8] = ResManager.createImage(90000048);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //圆角图片tishi.png
//#                    this.imgArray[3] = ResManager.createImage(90000050);
//#                    this.imgArray[3] = Tools.makeTransparent(this.imgArray[3], -1);
//#                    //背景遮罩图
//#                    this.imgArray[4] = Tools.makeTransparent(Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT / 2, 120, 0x00000000);
//#                    //表情
//#                    this.imgArray[5] = ResManager.createImage(90000048);
//#                    //确定返回
//#                    this.imgArray[6] = ResManager.createImage(90000043);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif

                //#if NOKIAN73 || NOKIA_S40V3  || NORMAL_240_400 || MOT0 || K790
                //#else 
                initchatSet();//聊天设置
                //#endif
                break;
            case Constant.GAME_UI_SEND_EMAIL://发送邮件
            case Constant.GAME_UI_VIEW_EMAIL://查看邮件
                sendORlist_index = 0;
                viewEmailoperation_index = 0;
                this.sStrArray = new String[3];
                sMarqueeString = "可通过邮件给好友或者其他玩家发送消息、物品和金钱，绑定物品和任务物品不可以交易。";
                emailArray = new String[]{"发件箱", "发送", "好友列表", "[收件人]", "[标题]", "[正文]", "[添加金钱]", "[添加附件]",
                    "金", "银", "铜", "取消附件", "返回"};
                viewEmailArray = new String[]{"收件箱", "收取附件", "删除", "[发件人]", "[标题]", "[正文]", "[金钱]", "[附件]",
                    "金", "银", "铜", "确定", "取消"};
                str5 = new String[]{"你确认删", "除此邮件", "邮件中包含附件"};
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[13];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                     //钱
                     this.imgArray[8] = ResManager.createImage(90000042);
                     //格子
                     this.imgArray[9] = Goods.createGoodsBg((byte) 1);
                     //物品等级数字
                     this.imgArray[10] = Tools.makeTransparent(ResManager.createImage(90000062), -1);
                     //圆角图片tishi2.png
                     this.imgArray[11] = Tools.makeTransparent(ResManager.createImage(90000052), -1);
                     //物品选择
                     this.imgArray[12] = ResManager.createImage(90000093);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                imgArray = new Image[12];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //圆角图片tishi.png
//#                    this.imgArray[3] = ResManager.createImage(90000050);
//#                    this.imgArray[3] = Tools.makeTransparent(this.imgArray[3], -1);
//#                    //背景遮罩图
//#                    this.imgArray[4] = Tools.makeTransparent(Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT / 2, 120, 0x00000000);
//#                    //钱
//#                    this.imgArray[5] = ResManager.createImage(90000042);
//#                    //格子
//#                    this.imgArray[6] = Goods.createGoodsBg((byte) 1);
//#                    //物品等级数字
//#                    this.imgArray[7] = ResManager.createImage(90000062);
//#                    this.imgArray[7] = Tools.makeTransparent(this.imgArray[7], -1);
//#                    //圆角图片tishi2.png
//#                    this.imgArray[8] = ResManager.createImage(90000052);
//#                    this.imgArray[8] = Tools.makeTransparent(this.imgArray[8], -1);
//#                    //确定返回
//#                    this.imgArray[9] = ResManager.createImage(90000043);
//#                    this.imgArray[10] = Goods.createGoodsBg((byte) 2);
//#                    //物品选择
//#                    this.imgArray[11] = ResManager.createImage(90000093);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
//#endif
                break;
            case Constant.GAME_UI_RECEIVE_EMAIL://接收邮件
            case Constant.GAME_UI_OPERATION_EMAIL:

                sMarqueeString = "可通过邮件给好友或者其他玩家发送消息、物品和金钱，绑定物品和任务物品不可以交易。";
                receiveArray = new String[]{"收件箱", "发件人", "标题", "天数", "/"};
                operationArray = new String[]{"确定", "返回", "取消"};
                str1 = new String[]{"打开邮件", "锁定邮件/解锁邮件", "删除邮件", "清空收件箱", "清除所有已读邮件"};
                str2 = new String[]{"你确认删", "除此邮件", "邮件中包含附件"};
                str3 = new String[]{"你确认删除所", "有已读邮件", "邮件中包含附件"};
                str4 = new String[]{"你确认清", "空收件箱", "邮件中包含附件"};
                //#if NOKIA_S60V5
                 num_email = (Constant.NEW_END_LINE - 41 - Constant.FONT_SMALL.getHeight()) / (Constant.FONT_SMALL.getHeight() + 3);
                 try {
                     this.imgArray = new Image[10];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
 //                     表情
                     this.imgArray[8] = ResManager.createImage(90000027);
                     this.imgArray[9] = Tools.makeTransparent(ResManager.createImage(90000052), -1);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                 
                 //Yujiang
                 setReceiveEmailTouchRect();
                //#else
//#                num_email = (Constant.SCREEN_HEIGHT - 48 - 20 - Constant.FONT_SMALL.getHeight()) / (Constant.FONT_SMALL.getHeight() + 2 + 1);
//#                imgArray = new Image[8];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //圆角图片tishi.png
//#                    this.imgArray[3] = ResManager.createImage(90000050);
//#                    this.imgArray[3] = Tools.makeTransparent(this.imgArray[3], -1);
//#                    //背景遮罩图
//#                    this.imgArray[4] = Tools.makeTransparent(Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT / 2, 120, 0x00000000);
//#                    //圆角图片tishi2.png
//#                    this.imgArray[5] = ResManager.createImage(90000052);
//#                    this.imgArray[5] = Tools.makeTransparent(this.imgArray[5], -1);
//#                    //邮件状态
//#                    this.imgArray[6] = ResManager.createImage(90000027);
//#                    //确定返回
//#                    this.imgArray[7] = ResManager.createImage(90000043);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                break;
            case Constant.GAME_UI_MERIDIANS:
                basicMeridians = new int[][]{//
                    {1, 2, 0},//
                    {3, 4, 5},//
                    {6, 7, 8},//
                    {9, 12, 10},//
                    {11, 14, 0},//
                    {13, 15, 0},//
                };
                basicStr = new String[][]{//
                    {"精气", "气血", ""},//
                    {"气力", "臂力", "灵敏"},//
                    {"体魄", "命中", "闪避"},//
                    {"防御", "暴击", "悟性"},//
                    {"恢复", "强攻", ""},//
                    {"精回", "技伤", ""},//
                };
                iceMeridians = new int[][]{//
                    {21, 0},//
                    {22, 23},//
                    {24, 25},//
                //                            {26, 0},//
                };
                iceStr = new String[][]{//
                    {"冰伤", ""},//
                    {"冰防", "冰抗"},//
                    {"减速", "冰触"},//
                //                            {"冰增", ""},//
                };
                fireMeridians = new int[][]{//
                    {31, 0},//
                    {32, 33},//
                    {34, 35},//
                //                            {36, 0},//
                };
                fireStr = new String[][]{//
                    {"火伤", ""},//
                    {"火防", "火抗"},//
                    {"减魔", "火触"},//
                //                            {"火增", ""},//
                };
                poisonMeridians = new int[][]{//
                    {41, 0},//
                    {42, 43},//
                    {44, 45},//
                //                            {46, 0},//
                };
                poisonStr = new String[][]{//
                    {"毒伤", ""},//
                    {"毒防", "毒抗"},//
                    {"减血", "毒触"},//
                //                            {"毒增", ""},//
                };
                basicArrow = new int[][]{//
                    {0, 0, 0, 0, 0},//
                    {0, 0, 1, 1, 1},//
                    {1, 0, 0, 0, 0},//
                    {0, 0, 1, 0, 0},//
                    {0, 0, 1, 0, 0},//
                };
                iceArrow = new int[][]{//
                    {1, 0, 0,},//
                    {1, 1, 0,},//
                //                            {1, 1, 0,},//
                };
                sMarqueeString = "影响人物属性的增长方向，需要消耗修为值来开通，分为基础、冰、火、毒4项，经脉一旦确定，除非用特殊道具否则不能更改。";
                sArray = new String[]{"基本", "冰系", "火系", "毒系"};
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[16];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                     this.imgArray[8] = Goods.createGoodsBg((byte) 1);
 //                //半透明图0xff0000
                     this.imgArray[9] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x989898);
                     //半透明图0xcccccc
                     this.imgArray[10] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xcccccc);
                     //半透明图0x00ccff
                     this.imgArray[11] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x00ccff);
                     //半透明图0xff0000
                     this.imgArray[12] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xff0000);
                     //半透明图0x00ff00
                     this.imgArray[13] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x00ff00);
                     //数字图片
                     this.imgArray[14] = Tools.makeTransparent(ResManager.createImage(90000062), 0xff);
                     //箭头
                     this.imgArray[15] = ResManager.createImage(90000016);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
                //#if NOKIA_E72
//#                 imgArray = new Image[13];
                //#else
//#                imgArray = new Image[12];
                //#endif
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //圆角图片tishi.png
//#                    this.imgArray[3] = ResManager.createImage(90000050);
//#                    this.imgArray[3] = Tools.makeTransparent(this.imgArray[3], -1);
//#                    //格子
//#//                    this.imgArray[4] = Goods.createGoodsBg((byte) 1);
//#                    this.imgArray[4] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x989898);
//#                    //数字图片
//#                    this.imgArray[5] = Tools.makeTransparent(ResManager.createImage(90000062), 0xff);
//#                    //箭头
//#                    this.imgArray[6] = ResManager.createImage(90000016);
//#//                    //技能图标
//#                    this.imgArray[7] = ResManager.createImage(90000043);
//#                    //半透明图0xcccccc
//#                    this.imgArray[8] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xcccccc);
//#                    //半透明图0x00ccff
//#                    this.imgArray[9] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x00ccff);
//#                    //半透明图0xff0000
//#                    this.imgArray[10] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0xff0000);
//#                    //半透明图0x00ff00
//#                    this.imgArray[11] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x00ff00);
                    //#if NOKIA_E72
//#                     //文字图片（确定，取消）
//#                     this.imgArray[12] = ResManager.createImage(90000060);
                    //#endif
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                meridianArray = new String[]{"经脉", "基本", ""};
                break;
            case Constant.GAME_UI_NOTICE_LIST:
                noticeListchoose_index = 0;
                noticelist_index = 0;
                sArray = new String[]{"新闻公告", "活动公告",};
                //#if NOKIA_S60V5
                 try {
                     this.imgArray = new Image[8];
                     this.imgArray[0] = ResManager.createImage(90000041); //小箭头图片
                     this.imgArray[1] = Tools.makeBlueMask(); //蓝色选择条
                     this.imgArray[2] = ResManager.createImage(90000017);//背景图片
                     this.imgArray[3] = Tools.makeTransparent(ResManager.createImage(90000051), 255); //边框图片
                     this.imgArray[4] = ResManager.createImage(90000086);//蓝条
                     this.imgArray[5] = ResManager.createImage(90000043);  //文字图片
                     this.imgArray[6] = ResManager.createImage(90000085);//确认按钮图片
                     this.imgArray[7] = ResManager.createImage(90000084);//方向键图片
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                //#else
//#                imgArray = new Image[4];
//#                try {
//#                    //箭头图片
//#                    this.imgArray[0] = ResManager.createImage(90000041);
//#                    //蓝色光片
//#                    this.imgArray[1] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                    //#if NOKIA_S40V3 || MOT0 || K790
                    //#elif NORMAL_240_400
//# //            imgArray[2] = ResManager.createImage(90000017);
//# //            imgArray[2] = Tools.ZoomImage(imgArray[2], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#else
//#                    //背景图片
//#                    this.imgArray[2] = ResManager.createImage(90000017);
                    //#endif
//#                    //确定返回
//#                    this.imgArray[3] = ResManager.createImage(90000043);
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                break;
            case Constant.GAME_UI_EXCHANGE:
                Exchange_index = 0;
                Exchange_num = 1;
                ExchangeRect_h = 100;
                isExchangedescription = false;
                if (Exchangenum * (Exchange_h + Constant.FONT_SMALL.getHeight()) + 35 > ExchangeRect_h) {
                    ExchangeRect_h = Exchangenum * (Exchange_h + Constant.FONT_SMALL.getHeight()) + 35;
                }
                imgArray = new Image[5];
                try {
                    this.imgArray[0] = Tools.makeTransparent(ResManager.createImage(90000051), 220);
                    //透明度
                    this.imgArray[1] = Tools.makeTransparent(10, ExchangeRect_h, 220, 0x989898);

                    this.imgArray[2] = Tools.makeBlueMask(); //蓝色光图
                    this.imgArray[3] = Tools.makeTransparent(10, EdescriptionRect_h, 220, 0x989898);
                    //箭头图片
                    this.imgArray[4] = ResManager.createImage(90000041);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                break;
            case Constant.GAME_UI_MAP_WORLD:
                this.mapWorld_Name = new String[]{//
                    "LV 1级 轩辕村", "LV 15级 安北城",
                    "LV 20级 极光营地", "LV 25级 暮歌村", "LV 30级 暮色营地", "LV 25级 天翔城集市", "LV 40级 咸水村", "LV 50级 晨风村"
                };
                this.mapWorldsend = new String[][]{
                    {"10023", "529", "1200"},//轩辕村
                    //                            {"10031", "104", "1809"},//北岸森林
                    {"10081", "584", "609"},//安北城
                    {"10042", "1811", "845"},//极光营地
                    {"10052", "1017", "3147"},//暮歌村
                    {"10093", "1526", "352"},//暮色营地
                    {"10062", "1181", "336"},//天翔城集市
                    {"11003", "237", "1476"},//咸水村
                    {"12001", "102", "1329"},//晨风村
                };

                mapArray = new String[]{"确定", "返回"};
                //#if NOKIA_S60V5
                 this.mapWorldPic_coordinates = new int[][]{//
                     {36, 314},//轩辕村
                     {76, 254},//北岸森林
 
                     {150, 150},//北疆高原
                     {213, 253},//丰饶平原
                     {220, 311},//天翔城
                     {138, 322},//绝望沼泽
                     {202, 451},//咸水村
                     {298, 376},//晨风村
                 };
                 imgArray = new Image[7];
                 try {
                     //蓝色光片
                     this.imgArray[0] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
                     //背景图片
                     this.imgArray[1] = ResManager.createImage(90000037);
                     //圆角图片tishi.png
                     this.imgArray[2] = ResManager.createImage(90000050);
                     this.imgArray[2] = Tools.makeTransparent(this.imgArray[2], -1);
                     //光标
                     this.imgArray[3] = ResManager.createImage(90000038);
                     this.imgArray[4] = ResManager.createImage(90000090);//方向键
                     this.imgArray[5] = ResManager.createImage(90000086);//底部蓝条
                     this.imgArray[6] = ResManager.createImage(90000043);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
 
                //#else
                //#if NOKIA_E72
//#                 this.mapWorldPic_coordinates = new int[][]{//
//#                     {65, 160},//轩辕村
//#                     {89, 124},//北岸森林
//#
//#                     {140, 56},//北疆高原
//#                     {184, 119},//丰饶平原
//#                     {191, 160},//天翔城
//#                     {129, 166},//绝望沼泽
//#                     {186, 261},//咸水村
//#                     {238, 205},//晨风村
//#                 };
                //#elif NORMAL_240_400
//#                 mapWorldPic_coordinates = new int[][]{//
//#                             {25, 200},//轩辕村
//#                             {49, 155},//北岸森林
//#                            
//#                             {100, 70},//北疆高原
//#                             {144, 148},//丰饶平原
//#                             {151, 200},//天翔城
//#                             {89, 207},//绝望沼泽
//#                             {146, 333},//咸水村
//#                             {198, 256},//晨风村
//#                         };
                //#else
//#                this.mapWorldPic_coordinates = new int[][]{//
//#                    {25, 160},//轩辕村
//#                    {49, 124},//北岸森林
//#                    //                            {81, 105},//安北城
//#                    {100, 56},//北疆高原
//#                    {144, 119},//丰饶平原
//#                    {151, 160},//天翔城
//#                    {89, 166},//绝望沼泽
//#                    {146, 261},//咸水村
//#                    {198, 205},//晨风村
//#                };
                //#endif
                //#if NOKIA_E72
//#                 imgArray = new Image[5];
                //#else
//#                imgArray = new Image[4];
                //#endif
//#                try {
//#                    //蓝色光片
//#                    this.imgArray[0] = Tools.createPicFromGrayscale(ResManager.createImage(90000029), 0x0099ff);
//#                    //背景图片
//#                    this.imgArray[1] = ResManager.createImage(90000037);
                    //#if NORMAL_240_400
//#                     imgArray[1] = Tools.ZoomImage(imgArray[1], Constant.DRAW_WIDTH, Constant.DRAW_HEIGHT);
                    //#endif
//#                    //圆角图片tishi.png
//#                    this.imgArray[2] = ResManager.createImage(90000050);
//#                    this.imgArray[2] = Tools.makeTransparent(this.imgArray[2], -1);
//#                    //光标
//#                    this.imgArray[3] = ResManager.createImage(90000038);
                    //#if NOKIA_E72
//#                     this.imgArray[4] = ResManager.createImage(90000113);
                    //#endif
//#                } catch (Exception e) {
//#                    e.printStackTrace();
//#                }
                //#endif
                //#if NOKIA_E72
//#                 Tools.initE72ScollBar();
                //#endif
                break;
        }
    }

    public void initSendMail() {
        emailItems = new Goods((short) 10, Constant.ITEM_COLUMN_TYPE_COMMON);
        items = new Goods((short) 10, Constant.ITEM_COLUMN_TYPE_COMMON);
//        num_email = (Constant.SCREEN_HEIGHT - 54 - Constant.FONT_SMALL.getHeight() * 3) / (Constant.FONT_SMALL.getHeight() + 2 + 1);
        //#if NOKIA_S60V5
         num_email = (Constant.NEW_END_LINE - 41 - Constant.FONT_SMALL.getHeight()) / (Constant.FONT_SMALL.getHeight() + 3);
        //#else
//#        num_email = (Constant.SCREEN_HEIGHT - 48 - 20 - Constant.FONT_SMALL.getHeight()) / (Constant.FONT_SMALL.getHeight() + 2 + 1);
        //#endif
        money_gold = 0;
        money_silver = 0;
        money_copper = 0;
        delet_Email = false;
        sendEmail_name = "";
        sendEmail_title = "";
        sendEmail_text = "";
        isSelected = new short[10][2];
        for (int i = 0; i < 10; i++) {
            isSelected[i][0] = -10;
            isSelected[i][1] = -10;
        }
        str_sendEmailText = new String[1];
        addgoods = false;
        checkUser = -1;
        showSysMessage = false;
    }
    /**
     * 技能开始
     */
    /**
     * 画技能界面
     */
    public Image[] imgArrayProfIcon;
    //获得职业技能图标

    public void getProfSkillIcon(int iconindex, String icon) {
        try {
            imgArrayProfIcon[iconindex] = ResManager.createImage(Integer.parseInt(icon));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static Image[] imgArrayTongIcon;
    //获得职业技能图标

    public void getTongSkillIcon(int iconindex, String icon) {
        try {
            imgArrayTongIcon[iconindex] = ResManager.createImage(Integer.parseInt(icon));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static Image[] imgArraykungfuIcon;
    //获得心法技能图标

    public void getkungfuSkillIcon(int iconindex, String icon) {
        try {
            imgArraykungfuIcon[iconindex] = ResManager.createImage(Integer.parseInt(icon));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private static byte Skill_operationTyte;
    private final byte Skill_interface = 0;
    private final byte Skill_operation = 1;
    private final byte Skill_view = 2;
    private final byte Skill_del = 3;
    private String[] Skill_operationStr;
    private boolean isSkillactive;//是否是主动技能

    public void drawSkill(Graphics g) {

        //#if NOKIA_S60V5
         Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                 this.imgArray[6], this.imgArray[4], this.imgArray[5], this.sArray[0]);
         int start_Y = 41;
         int start_H = (Constant.SCREEN_HEIGHT - 41 - 240) / 3;
         int spacingPackageBox = 2;
         int spacing_H = (start_H - Constant.FONT_SMALL.getHeight() - 88 - spacingPackageBox) / 3;
         Tools.drawShadowString(g, (byte) 1, this.sArray[1], Constant.UI_START_X + 5,
                 Constant.UI_START_Y + start_Y + spacing_H, (skillindex < 14) ? 0x00E7FF : 0xFFFFFF, 0x333333);
         Tools.drawShadowString(g, (byte) 1, this.sArray[2], Constant.UI_START_X + 5,
                 Constant.UI_START_Y + start_Y + spacing_H + start_H,
                 (skillindex >= 14 && skillindex < 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
         Tools.drawShadowString(g, (byte) 1, this.sArray[3], Constant.UI_START_X + 5,
                 Constant.UI_START_Y + start_Y + spacing_H + start_H * 2,
                 (skillindex >= 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
 
         //画格子职业技能
         for (int i = 0; i < 14; i++) {
             Tools.drawS60V5ItemBg(g, this.imgArray[8], this.imgArray[9], (byte) -1,
                     (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                     + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7),
                     Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
                     + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7));
         }
         //画得到的职业技能
         if (profNum.length > 0) {
             for (int i = 0; i < profNum[0]; i++) {
                 if (imgArrayProfIcon[i] != null) {
                     if (profType[i] != 0) {
                         //imgArray[8]
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 15 + 5,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_NONE);
                     }
                     g.drawImage(imgArrayProfIcon[i], (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                             + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
                             + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7, 0);
                 }
             }
             //画技能名字
             if (skillindex < 14 && skillindex < profNum.length) {
                 if (profName[skillindex] != null) {
                     Tools.drawShadowString(g, (byte) 1, profName[skillindex], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth("职业技能："),
                             Constant.UI_START_Y + start_Y + spacing_H, 0xFFFFFF, 0x333333);
                 }
             }
         }
         //画格子心法技能
         for (int i = 0; i < 14; i++) {
             Tools.drawS60V5ItemBg(g, this.imgArray[8], this.imgArray[9], (byte) -1,
                     (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                     + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7),
                     Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                     + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7));
             if (i >= openNum[0]) {
                 g.setColor(0x000000);
                 int x = 6;
                 g.drawLine((Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                         + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + x,
                         Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                         + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + x,
                         (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                         + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 29 + x,
                         Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                         + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 29 + x);
                 g.drawLine((Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                         + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 29 + x,
                         Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                         + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + x,
                         (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                         + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + x,
                         Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                         + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 29 + x);
             }
 
         }
         //画得到的心法技能
         if (kungfuNum.length > 0) {
             for (int i = 0; i < kungfuNum[0]; i++) {
                 if (imgArraykungfuIcon[i] != null) {
                     if (kungfuType[i] != 0) {
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 15 + 5,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_NONE);
                     }
                     g.drawImage(imgArraykungfuIcon[i], (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                             + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
                             + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7, 0);
                 }
             }
             //画技能名字
             if (skillindex >= 14 && skillindex < 28 && (skillindex - 14 < kungfuNum.length)) {
                 if (kungfuName[skillindex - 14] != null) {
                     Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth("心法技能："),
                             Constant.UI_START_Y + start_Y + spacing_H + start_H, 0xFFFFFF, 0x333333);
                 }
             }
         }
         //画格子帮派技能
         for (int i = 0; i < 14; i++) {
             Tools.drawS60V5ItemBg(g, this.imgArray[8], this.imgArray[9], (byte) -1,
                     (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                     + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7),
                     Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
                     + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7));
         }
         //画得到的帮派技能
         if (tongNum.length > 0) {
             for (int i = 0; i < tongNum[0]; i++) {
                 if (imgArrayTongIcon[i] != null) {
                     if (tongType[i] != 0) {
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
                                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 15 + 5,
                                 28, this.imgArray[10],
                                 0, this.imgArray[10].getHeight() - 15,
                                 this.imgArray[10].getWidth(), 15, Constant.TRANS_NONE);
                     }
                     g.drawImage(imgArrayTongIcon[i], (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                             + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (i % 7) + 7,
                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
                             + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * (i / 7) + 7, 0);
                 }
             }
             //画技能名字
             if (skillindex >= 28 && (skillindex - 28 < tongNum.length)) {
                 if (tongName[skillindex - 28] != null) {
                     Tools.drawShadowString(g, (byte) 1, tongName[skillindex - 28], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth("帮派技能："),
                             Constant.UI_START_Y + start_Y + spacing_H + start_H * 2, 0xFFFFFF, 0x333333);
                 }
             }
         }
         //职业技能格子遮罩
         int tilePic_H = spacing_H * 2;
         int skillindex_row = 0;
         if (skillindex >= 14 && skillindex < 28) {
             tilePic_H = spacing_H * 2 + start_H;
             skillindex_row = 14;
         } else if (skillindex >= 28) {
             tilePic_H = spacing_H * 2 + start_H * 2;
             skillindex_row = 28;
         }
         //横条
 //        Tools.drawTilePic(g, (byte) 1, 0,
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7) + (this.imgArray[8].getHeight() + 14),
 //                Constant.SCREEN_WIDTH, this.imgArray[1],
 //                0, this.imgArray[1].getHeight() - 15,
 //                this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
 //        g.setColor(0x000000);
 //        g.drawLine(0, Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7) + (this.imgArray[8].getHeight() + 7) * 2,
 //                Constant.SCREEN_WIDTH,
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7) + (this.imgArray[8].getHeight() + 7) * 2);
 //
         Goods.drawGoodsSelectStytle(g, imgArray[11], (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                 + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7),
                 Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
                 + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7));
         //上
 //        Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
 //                + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7),
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7) - this.imgArray[8].getHeight(),
 //                44, this.imgArray[1],
 //                0, this.imgArray[1].getHeight() - 15,
 //                this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
 //        //下
 //        Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
 //                + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7),
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7) + (this.imgArray[8].getHeight()) * 2 + 11,
 //                44, this.imgArray[1],
 //                0, this.imgArray[1].getHeight() - 15,
 //                this.imgArray[1].getWidth(), 15, Constant.TRANS_ROT180);
 //        //左
 //        Tools.drawTilePic(g, (byte) 2, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
 //                + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7) + this.imgArray[8].getWidth() * 2 + 11,
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7),
 //                44, this.imgArray[1],
 //                0, this.imgArray[1].getHeight() - 15,
 //                this.imgArray[1].getWidth(), 15, Constant.TRANS_MIRROR_ROT90);
 //        //右
 //        Tools.drawTilePic(g, (byte) 2, (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
 //                + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7) - this.imgArray[8].getWidth(),
 //                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
 //                + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7),
 //                44, this.imgArray[1],
 //                0, this.imgArray[1].getHeight() - 15,
 //                this.imgArray[1].getWidth(), 15, Constant.TRANS_MIRROR_ROT270);
         //绘制操作
         switch (Skill_operationTyte) {
             case Skill_operation:
                 Tools.drawPopMenu(g, Skill_operationStr,
                         (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
                         Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) skillSelectindex,
                         (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
                         + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7),
                         Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
                         + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7));
                 break;
             case Skill_del:
                 int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
                 Tools.drawPopUp(g, (byte) 4, 2, (Constant.SCREEN_HEIGHT - smallrect_h) / 2,
                         Constant.SCREEN_WIDTH - 4, smallrect_h, imgArray[3], 0x989898,
                         null, 0, 0, 0, 0, null, 0, 0, 0, 0,
                         this.sArray[4], null);
                 Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                         - Constant.FONT_SMALL.stringWidth(kungfuName[skillindex - 14])) >> 1),
                         (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2),
                         0xff0000, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, this.sArray[5], 12,
                         (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                         delkungfu_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, this.sArray[6], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth("取消"),
                         (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                         delkungfu_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
                 break;
             case Skill_view:
                 int start_x = 9;
                 int start_y = 70;
                 if (skillDescription != null) {
                     if (skillDescription[0] != null) {
                         Tools.drawPopUp(g, (byte) 4, 2, start_y,
                                 Constant.SCREEN_WIDTH - 4, Constant.SCREEN_HEIGHT - start_y * 2, imgArray[3], 0x989898,
                                 null, 0, 0, 0, 0, null, 0, 0, 0, 0,
                                 skillDescription[0], null);
 
                         Tools.drawShadowString(g, (byte) 1, this.sArray[7], Constant.UI_START_X + start_x,
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0xFFFFFF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, skillDescription[1], Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[7]),
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0x00E7FF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, this.sArray[8], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2,
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0xFFFFFF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, skillDescription[2], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(this.sArray[8]),
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0x00E7FF, 0x333333);
                         //
                         Tools.drawShadowString(g, (byte) 1, this.sArray[9], Constant.UI_START_X + start_x,
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0xFFFFFF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, skillDescription[4], Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[9]),
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0x00E7FF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, this.sArray[10], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2,
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0xFFFFFF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, skillDescription[5], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(this.sArray[10]),
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0x00E7FF, 0x333333);
                         //
                         Tools.drawShadowString(g, (byte) 1, this.sArray[11], Constant.UI_START_X + start_x,
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 3 + 4, 0xFFFFFF, 0x333333);
                         Tools.drawShadowString(g, (byte) 1, skillDescription[3].equals("0") ? this.sArray[12] : this.sArray[13],
                                 Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[11]),
                                 Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 3 + 4, 0x00E7FF, 0x333333);
                         //
                         Tools.drawHCycleRollingParagraph(g, skillDescription[6],
                                 skillDescription_Height, Constant.SCREEN_WIDTH - start_x * 2,
                                 Constant.SCREEN_HEIGHT - start_y * 2 - (Constant.FONT_SMALL.getHeight() * 4 + 4) - 7,
                                 Constant.FONT_SMALL.getHeight(),
                                 start_x, Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 4 + 4,
                                 0xffffff, 0x000000);
                     }
                 }
                 break;
         }
        //#else
        //#if NOKIA_E72
//#         Tools.drawE72Frame(g, this.imgArray[2], this.imgArray[4], this.sArray[0]);
//#         int Start_x = Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12 - 5;
        //#else
//#        Tools.drawFrame(g, Constant.UI_START_X, Constant.UI_START_Y,
//#                this.imgArray[2], this.imgArray[0], this.imgArray[1], this.imgArray[6],
//#                0, 0, 24, 12,
//#                this.imgArray[6], 48, 0, 24, 12,
//#                this.sArray[0], 0xFFFFFF);
//#        int Start_x = (Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12) / 2;
        //#endif
//#        //
//#        int start_Y = 21;
//#        int start_H = (Constant.SCREEN_HEIGHT - 21 - 25) / 3;
//#        int spacingPackageBox = 2;
//#        int spacing_H = (start_H - Constant.FONT_SMALL.getHeight() - 60 - spacingPackageBox) / 3;
        //#if NOKIA_E72
//#         Tools.drawShadowString(g, (byte) 1, this.sArray[1], Constant.UI_START_X + 5,
//#                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight(), (skillindex < 14) ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#         Tools.drawShadowString(g, (byte) 1, this.sArray[2], Constant.UI_START_X + 5,
//#                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H,
//#                 (skillindex >= 14 && skillindex < 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#         Tools.drawShadowString(g, (byte) 1, this.sArray[3], Constant.UI_START_X + 5,
//#                 Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2,
//#                 (skillindex >= 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
        //#else
//#        Tools.drawShadowString(g, (byte) 1, this.sArray[1], Constant.UI_START_X + 5,
//#                Constant.UI_START_Y + start_Y + spacing_H, (skillindex < 14) ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#        Tools.drawShadowString(g, (byte) 1, this.sArray[2], Constant.UI_START_X + 5,
//#                Constant.UI_START_Y + start_Y + spacing_H + start_H,
//#                (skillindex >= 14 && skillindex < 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#        Tools.drawShadowString(g, (byte) 1, this.sArray[3], Constant.UI_START_X + 5,
//#                Constant.UI_START_Y + start_Y + spacing_H + start_H * 2,
//#                (skillindex >= 28) ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#endif
//#        //画格子职业技能
//#        for (int i = 0; i < 14; i++) {
//#            drawPackageBox(g, this.imgArray[3],
//#                    Start_x
//#                    + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7),
//#                    Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
//#                    + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7),
//#                    (byte) 0, 15, 15);
//#        }
//#        //画得到的职业技能
//#        if (profNum.length > 0) {
//#            for (int i = 0; i < profNum[0]; i++) {
//#                if (imgArrayProfIcon[i] != null) {
//#                    if (profType[i] != 0) {
//#                        //imgArray[8]
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 15 - 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_NONE);
//#                    }
//#                    g.drawImage(imgArrayProfIcon[i], Start_x
//#                            + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                            Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight()
//#                            + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1, 0);
//#                }
//#            }
//#            //画技能名字
//#            if (skillindex < 14 && skillindex < profNum.length) {
//#                if (profName[skillindex] != null) {
                    //#if NOKIA_E72
//#                     Tools.drawShadowString(g, (byte) 1, profName[skillindex], Constant.UI_START_X + 5,
//#                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2, 0xFFFFFF, 0x333333);
                    //#else
//#                    Tools.drawShadowString(g, (byte) 1, profName[skillindex], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth(this.sArray[1]),
//#                            Constant.UI_START_Y + start_Y + spacing_H, 0xFFFFFF, 0x333333);
                    //#endif
//#                }
//#            }
//#        }
//#        //画格子心法技能
//#        for (int i = 0; i < 14; i++) {
//#            drawPackageBox(g, this.imgArray[3],
//#                    Start_x
//#                    + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7),
//#                    Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
//#                    + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7),
//#                    i < openNum[0] ? (byte) 0 : (byte) 1, 15, 15);
//#
//#        }
//#        //画得到的心法技能
//#        if (kungfuNum.length > 0) {
//#            for (int i = 0; i < kungfuNum[0]; i++) {
//#                if (imgArraykungfuIcon[i] != null) {
//#                    if (kungfuType[i] != 0) {
//#                        //imgArray[8]
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 15 - 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_NONE);
//#                    }
//#                    g.drawImage(imgArraykungfuIcon[i], Start_x
//#                            + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                            Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H
//#                            + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1, 0);
//#                }
//#            }
//#            //画技能名字
//#            if (skillindex >= 14 && skillindex < 28 && (skillindex - 14 < kungfuNum.length)) {
//#                if (kungfuName[skillindex - 14] != null) {
                    //#if NOKIA_E72
//#                     Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + 5,
//#                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2 + start_H, 0xFFFFFF, 0x333333);
                    //#else
//#                    Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth(this.sArray[1]),
//#                            Constant.UI_START_Y + start_Y + spacing_H + start_H, 0xFFFFFF, 0x333333);
                    //#endif
//#
//#                }
//#            }
//#        }
//#        //画格子帮派技能
//#        for (int i = 0; i < 14; i++) {
//#            drawPackageBox(g, this.imgArray[3],
//#                    Start_x
//#                    + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7),
//#                    Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
//#                    + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7),
//#                    (byte) 0, 15, 15);
//#        }
//#        //画得到的帮派技能
//#        if (tongNum.length > 0) {
//#            for (int i = 0; i < tongNum[0]; i++) {
//#                if (imgArrayTongIcon[i] != null) {
//#                    if (tongType[i] != 0) {
//#                        //imgArray[8]
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, Start_x
//#                                + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                                Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
//#                                + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 15 - 1,
//#                                28, this.imgArray[8],
//#                                0, this.imgArray[8].getHeight() - 15,
//#                                this.imgArray[8].getWidth(), 15, Constant.TRANS_NONE);
//#                    }
//#                    g.drawImage(imgArrayTongIcon[i], Start_x
//#                            + (this.imgArray[3].getWidth() * 2 + 2) * (i % 7) + 1,
//#                            Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() + start_H * 2
//#                            + (this.imgArray[3].getHeight() * 2 + 2) * (i / 7) + 1, 0);
//#                }
//#            }
//#            //画技能名字
//#            if (skillindex >= 28 && (skillindex - 28 < tongNum.length)) {
//#                if (tongName[skillindex - 28] != null) {
                    //#if NOKIA_E72
//#                     Tools.drawShadowString(g, (byte) 1, tongName[skillindex - 28], Constant.UI_START_X + 5,
//#                             Constant.UI_START_Y + start_Y + spacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2 + start_H * 2, 0xFFFFFF, 0x333333);
                    //#else
//#                    Tools.drawShadowString(g, (byte) 1, tongName[skillindex - 28], Constant.UI_START_X + 7 + Constant.FONT_SMALL.stringWidth(this.sArray[1]),
//#                            Constant.UI_START_Y + start_Y + spacing_H + start_H * 2, 0xFFFFFF, 0x333333);
                    //#endif
//#
//#                }
//#            }
//#        }
//#        //职业技能格子遮罩
//#        int tilePic_H = spacing_H * 2;
//#        int skillindex_row = 0;
//#        if (skillindex >= 14 && skillindex < 28) {
//#            tilePic_H = spacing_H * 2 + start_H;
//#            skillindex_row = 14;
//#        } else if (skillindex >= 28) {
//#            tilePic_H = spacing_H * 2 + start_H * 2;
//#            skillindex_row = 28;
//#        }
//#        //横条
//#//        Tools.drawTilePic(g, (byte) 1, 0,
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7) + this.imgArray[3].getHeight(),
//#//                Constant.SCREEN_WIDTH, this.imgArray[1],
//#//                0, this.imgArray[1].getHeight() - 15,
//#//                this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
//#//        g.setColor(0x000000);
//#//        g.drawLine(0, Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7) + this.imgArray[3].getHeight() * 2,
//#//                Constant.SCREEN_WIDTH,
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7) + this.imgArray[3].getHeight() * 2);
//#        Goods.drawGoodsSelectStytle(g, imgArray[9], Start_x
//#                + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7),
//#                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7));
//#        //上
//#//        Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12) / 2
//#//                + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7),
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7) - this.imgArray[3].getHeight(),
//#//                30, this.imgArray[1],
//#//                0, this.imgArray[1].getHeight() - 15,
//#//                this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
//#//        //下
//#//        Tools.drawTilePic(g, (byte) 1, (Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12) / 2
//#//                + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7),
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7) + this.imgArray[3].getHeight() * 2,
//#//                30, this.imgArray[1],
//#//                0, this.imgArray[1].getHeight() - 15,
//#//                this.imgArray[1].getWidth(), 15, Constant.TRANS_ROT180);
//#//        //左
//#//        Tools.drawTilePic(g, (byte) 2, (Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12) / 2
//#//                + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7) + this.imgArray[3].getWidth() * 2,
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7),
//#//                30, this.imgArray[1],
//#//                0, this.imgArray[1].getHeight() - 15,
//#//                this.imgArray[1].getWidth(), 15, Constant.TRANS_MIRROR_ROT90);
//#//        //右
//#//        Tools.drawTilePic(g, (byte) 2, (Constant.SCREEN_WIDTH - (this.imgArray[3].getWidth() * 14) - 12) / 2
//#//                + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7) - this.imgArray[3].getWidth(),
//#//                Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#//                + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7),
//#//                30, this.imgArray[1],
//#//                0, this.imgArray[1].getHeight() - 15,
//#//                this.imgArray[1].getWidth(), 15, Constant.TRANS_MIRROR_ROT270);
//#        //绘制操作
//#        switch (Skill_operationTyte) {
//#            case Skill_operation:
//#                Tools.drawPopMenu(g, Skill_operationStr,
//#                        (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
//#                        Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) skillSelectindex,
//#                        Start_x
//#                        + (this.imgArray[3].getWidth() * 2 + 2) * (skillindex % 7),
//#                        Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//#                        + (this.imgArray[3].getHeight() * 2 + 2) * ((skillindex - skillindex_row) / 7));
//#                break;
//#            case Skill_del:
//#                int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
//#                Tools.drawPopUp(g, (byte) 4, 2, (Constant.SCREEN_HEIGHT - smallrect_h) / 2,
//#                        Constant.SCREEN_WIDTH - 4, smallrect_h, imgArray[7], 0x989898,
//#                        null, 0, 0, 0, 0, null, 0, 0, 0, 0,
//#                        this.sArray[4], null);
//#                Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
//#                        - Constant.FONT_SMALL.stringWidth(kungfuName[skillindex - 14])) >> 1),
//#                        (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2),
//#                        0xff0000, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, this.sArray[5], 12,
//#                        (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//#                        delkungfu_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, this.sArray[6], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth("取消"),
//#                        (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//#                        delkungfu_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
//#                break;
//#            case Skill_view:
//#                int start_x = 9;
                //#if NOKIA_E72
//#                 int start_y = 30;
                //#else
//#                int start_y = 70;
                //#endif
//#                if (skillDescription != null) {
//#                    if (skillDescription[0] != null) {
//#                        Tools.drawPopUp(g, (byte) 4, 2, start_y,
//#                                Constant.SCREEN_WIDTH - 4, Constant.SCREEN_HEIGHT - start_y * 2, imgArray[7], 0x989898,
//#                                null, 0, 0, 0, 0, null, 0, 0, 0, 0,
//#                                skillDescription[0], null);
//#
//#                        Tools.drawShadowString(g, (byte) 1, this.sArray[7], Constant.UI_START_X + start_x,
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0xFFFFFF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, skillDescription[1], Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[7]),
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0x00E7FF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, this.sArray[8], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2,
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0xFFFFFF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, skillDescription[2], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(this.sArray[8]),
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() + 4, 0x00E7FF, 0x333333);
//#                        //
//#                        Tools.drawShadowString(g, (byte) 1, this.sArray[9], Constant.UI_START_X + start_x,
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0xFFFFFF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, skillDescription[4], Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[9]),
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0x00E7FF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, this.sArray[10], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2,
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0xFFFFFF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, skillDescription[5], Constant.UI_START_X + start_x + Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(this.sArray[10]),
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 2 + 4, 0x00E7FF, 0x333333);
//#                        //
//#                        Tools.drawShadowString(g, (byte) 1, this.sArray[11], Constant.UI_START_X + start_x,
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 3 + 4, 0xFFFFFF, 0x333333);
//#                        Tools.drawShadowString(g, (byte) 1, skillDescription[3].equals("0") ? this.sArray[12] : this.sArray[13],
//#                                Constant.UI_START_X + start_x + Constant.FONT_SMALL.stringWidth(this.sArray[11]),
//#                                Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 3 + 4, 0x00E7FF, 0x333333);
//#                        //
//#                        Tools.drawHCycleRollingParagraph(g, skillDescription[6],
//#                                skillDescription_Height, Constant.SCREEN_WIDTH - start_x * 2,
//#                                Constant.SCREEN_HEIGHT - start_y * 2 - (Constant.FONT_SMALL.getHeight() * 4 + 4) - 7,
//#                                Constant.FONT_SMALL.getHeight(),
//#                                start_x, Constant.UI_START_Y + start_y + Constant.FONT_SMALL.getHeight() * 4 + 4,
//#                                0xffffff, 0x000000);
//#                    }
//#                }
//#                break;
//#        }
        //#endif
         if (mskillTouchRect != null) {
        	 for (int i=0;i<42;i++) {
        		 g.setColor(0xff0000);
        		 int[] rect = mskillTouchRect[i];
        		 if (rect != null)
        			 g.drawRect(rect[0], rect[1], rect[2], rect[3]);
        	 }
         }
    }
    private int[][] mskillTouchRect;
    private int[][] mopretionRect;
    private int[][] mdelRect;
    public void checkSkillTouch(int x, int y) {
    	if (mskillTouchRect == null) {
    		mskillTouchRect = new int[42][];
    		int startx = 18;
    		int starty = 64;
    		for (int i=0;i<6;i++) {
    			for(int j=0;j<7;j++) {
    				int curx = startx + j*(6+40);
    				mskillTouchRect[i*7+j] = new int[]{
    						curx, starty ,40,40,	
    				};
    			}
    			int space = 6;
    			if (i == 1 || i == 3) {
    				space = 31;
    			}
    			starty +=(space + 40);
    		}
    	}
    	switch(Skill_operationTyte) {
    	case Skill_interface:
    		int touched = MainCanvas.checkTouch(x, y, mskillTouchRect);
    		if (touched >=0 ) {
    			if (skillindex == touched) {//已经是选择状态，如果在点击，就弹出菜单。
    				//模拟按回车键
    				MainCanvas.pressFire();
    			} else {
    				skillindex = touched;
    			}
    		} else {
    			MainCanvas.checkSoftKey();
    		}
    		break;
    	case Skill_operation:
    		int size = Skill_operationStr.length;
    		mopretionRect = new int[size][];
    		//这里的坐标计算是从draw方法里面扣出来的。
            int start_Y = 41;
            int start_H = (Constant.SCREEN_HEIGHT - 41 - 240) / 3;
            int spacingPackageBox = 2;
            int spacing_H = (start_H - Constant.FONT_SMALL.getHeight() - 88 - spacingPackageBox) / 3;
            int tilePic_H = spacing_H * 2;
            int skillindex_row = 0;
            if (skillindex >= 14 && skillindex < 28) {
                tilePic_H = spacing_H * 2 + start_H;
                skillindex_row = 14;
            } else if (skillindex >= 28) {
                tilePic_H = spacing_H * 2 + start_H * 2;
                skillindex_row = 28;
            }
    		int startX = (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
            + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7);
            int startY = Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
            + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7);
//            Tools.drawPopMenu(g, Skill_operationStr,
//                    (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
//                    Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) skillSelectindex,
//                    (Constant.SCREEN_WIDTH - ((this.imgArray[8].getWidth() + 7) * 14) - 12) / 2
//                    + ((this.imgArray[8].getWidth() + 7) * 2 + 2) * (skillindex % 7),
//                    Constant.UI_START_Y + start_Y + tilePic_H + Constant.FONT_SMALL.getHeight()
//                    + ((this.imgArray[8].getHeight() + 7) * 2 + 2) * ((skillindex - skillindex_row) / 7));
            int lineHeight = Constant.FONT_SMALL_HEIGHT + 1;
            lineHeight = lineHeight < Constant.FONT_SMALL_HEIGHT ? Constant.FONT_SMALL_HEIGHT : lineHeight;
            int height = lineHeight * size + 10;
            int width = Constant.FONT_SMALL.stringWidth("查看") + 2;
            //#if NOKIA_S60V5
             height = height < 41 ? 41 : height;
            //#else
    //#        height = height < 31 ? 31 : height;
            //#endif
//            setColor(g, bgBolor);
            if (startY + height > Constant.UI_START_Y + Constant.SCREEN_HEIGHT) {
                startY = Constant.UI_START_Y + Constant.SCREEN_HEIGHT - height - 2;
            }
            if (startX + width > Constant.UI_START_X + Constant.DRAW_WIDTH) {
                startX = Constant.UI_START_X + Constant.DRAW_WIDTH - width - 2;
            }
            for (int i = 0; i < size; i++) {
//                switch (byAlign) {
//                    case 3:
//                        iStartX = startX + width - 5 - Constant.FONT_SMALL.stringWidth(sOpArray[i]);
//                        break;
//                    case 1:
//                        iStartX = startX + ((width - Constant.FONT_SMALL.stringWidth(sOpArray[i])) >> 1);
//                        break;
//                }
//                if (bySelectIndex == i) {
//                    setColor(g, selectedColor);
//                } else {
//                    setColor(g, fontColor);
//                }
//                g.drawString(sOpArray[i], iStartX, startY + 5 + i * lineHeight, 0);
            	mopretionRect[i] = new int[]{
            			startX, startY + 5 + i * lineHeight,width,lineHeight
            	};
            }
            touched = MainCanvas.checkTouch(startX, startY, mopretionRect);
            if (touched >= 0) {//这个是个popmenu，如果点击菜单是选择。
//            	if (skillSelectindex == touched) {
            		skillSelectindex = touched;
            		MainCanvas.pressFire();
//            	} else {
//            		skillSelectindex = touched;//这个这里不用加便宜值，比较方便。
//            	}
            } else {//为点击在菜单上面，则隐藏菜单。模拟按右软键。
            	MainCanvas.pressBack();
            }
    		break;
    	case Skill_view:
//            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
//                Skill_operationTyte = Skill_operation;
//                skillDescription = null;
//            }
    		MainCanvas.checkSoftKey();//update里面只有返回按键处理，触摸则模拟左右软键就行。
            break;
        case Skill_del:
        	//draw
        	int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
//            Tools.drawPopUp(g, (byte) 4, 2, (Constant.SCREEN_HEIGHT - smallrect_h) / 2,
//                    Constant.SCREEN_WIDTH - 4, smallrect_h, imgArray[3], 0x989898,
//                    null, 0, 0, 0, 0, null, 0, 0, 0, 0,
//                    this.sArray[4], null);
//            Tools.drawShadowString(g, (byte) 1, kungfuName[skillindex - 14], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
//                    - Constant.FONT_SMALL.stringWidth(kungfuName[skillindex - 14])) >> 1),
//                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2),
//                    0xff0000, 0x000000);
//            Tools.drawShadowString(g, (byte) 1, this.sArray[5], 12,
//                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//                    delkungfu_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//            Tools.drawShadowString(g, (byte) 1, this.sArray[6], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth("取消"),
//                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//                    delkungfu_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
            //根据draw获取坐标。
            int w = Constant.FONT_SMALL.stringWidth("取消");
            mdelRect = new int[][]{
            		{12,(Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3, w, Constant.FONT_SMALL.getHeight() + 2},
            		{Constant.SCREEN_WIDTH - 12 - w,(Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3, w, Constant.FONT_SMALL.getHeight() + 2},
            };
        	//update
//            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
//                delkungfu_index = delkungfu_index < 1 ? (delkungfu_index + 1) : 0;
//            }
//            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
//                delkungfu_index = delkungfu_index > 0 ? (delkungfu_index - 1) : 1;
//            }
//            if (delkungfu_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
//                delkungfu_id = skillindex - 14;
//                MainLogic.getInstance().send(Constant.MSG_NET_UNLEARN_SKILL, Constant.SOCKET_MSG_TYPE_LOGIC);
//            }
//            if (delkungfu_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
//                Skill_operationTyte = Skill_operation;
//            }
            //根据update实现触摸逻辑。
            touched = MainCanvas.checkTouch(x, y, mdelRect);
            if (touched >= 0) {
            	if (delkungfu_index == touched) {//单击选择，如果已经是选择的，单击则等于是按回车键。
            		MainCanvas.pressFire();
            	} else {
            		delkungfu_index = touched;
            	}
            } else {
            	MainCanvas.pressBack();
            }
            break;
    	}
    }

    private void drawPackageBox(Graphics g, Image img, int startX, int startY, byte iState, int imgW, int imgH) {
        g.drawImage(img, startX, startY, 0);
        g.drawRegion(img, 0, 0, imgW, imgH, Constant.TRANS_MIRROR, startX + imgW, startY, 0);
        g.drawRegion(img, 0, 0, imgW, imgH, Constant.TRANS_MIRROR_ROT180, startX, startY + imgH, 0);
        g.drawRegion(img, 0, 0, imgW, imgH, Constant.TRANS_ROT180, startX + imgW, startY + imgH, 0);
        if (iState == 1) {
            //当前格子不可用
            g.setColor(0x000000);
            g.drawLine(startX, startY, startX + imgW * 2 - 1, startY + imgH * 2 - 1);
            g.drawLine(startX + imgW * 2 - 1, startY, startX, startY + imgH * 2 - 1);
        }
    }
    private String[] skillDescription;
    private int skillDescription_Height;

    public void getskillDescription(String skill_name, byte now_level, byte highest_level,
            byte skill_type, int sp_num, int cd_num, String skill_Description) {
        skillDescription = new String[7];
        skillDescription[0] = skill_name;
        skillDescription[1] = "" + now_level;
        skillDescription[2] = "" + highest_level;
        skillDescription[3] = "" + skill_type;
        skillDescription[4] = "" + sp_num;
        skillDescription[5] = "" + cd_num;
        skillDescription[6] = skill_Description;
        skillDescription_Height = Tools.getParagraphHeight(skill_Description, Constant.SCREEN_WIDTH - 18,
                Constant.FONT_SMALL.getHeight());
    }
    //职业技能
    private byte profType[];
    private short proficonKey[], profNum[];
    private String profKey[], profName[];
    private static int delkungfu_index;
    public static int delkungfu_id;

    public void delKungfu(int id) {
        this.kungfuKey[id] = null;
        this.iconKey[id] = -1;
        this.kungfuName[id] = null;
        this.kungfuType[id] = -1;
        imgArraykungfuIcon[id] = null;
        Skill_operationTyte = Skill_interface;
    }

    public void initProfSkill(int index) {
        profNum = new short[index];
        proficonKey = new short[index];
        profKey = new String[index];
        profName = new String[index];
        profType = new byte[index];
    }

    public void getProfSkillInformation(int index, short profNum, String profKey, short proficonKey,
            String profName, byte profType) {
        this.profNum[index] = profNum;
        this.profKey[index] = profKey;
        this.proficonKey[index] = proficonKey;
        this.profName[index] = profName;
        this.profType[index] = profType;

    }
    //帮派技能
    private byte tongType[];
    private short tongiconKey[], tongNum[];
    private String tongKey[], tongName[];

    public void inittongSkill(int index) {
        tongNum = new short[index];
        tongiconKey = new short[index];
        tongKey = new String[index];
        tongName = new String[index];
        tongType = new byte[index];
    }

    public void gettongSkillInformation(int index, short tongNum, String tongKey, short tongiconKey,
            String tongName, byte tongType) {
        this.tongNum[index] = tongNum;
        this.tongKey[index] = tongKey;
        this.tongiconKey[index] = tongiconKey;
        this.tongName[index] = tongName;
        this.tongType[index] = tongType;
    }
    //心法
    private short openNum[];
    private byte kungfuType[];
    private short kungfuNum[];
    private short iconKey[];
    public String kungfuKey[], kungfuName[];

    public void initSkill(int index) {
        this.kungfuNum = new short[index];
        this.kungfuKey = new String[index];
        this.iconKey = new short[index];
        this.kungfuName = new String[index];
        this.kungfuType = new byte[index];
    }

    public void getSkillOpenNum(short openNum) {
        this.openNum = new short[1];
        this.openNum[0] = openNum;
    }

    public void getSkillInformation(int index, short kungfuNum, String kungfuKey, short iconKey,
            String kungfuName, byte kungfuType) {
        //状态(byte)开启槽个数(byte)心法个数(byte)心法key(8byte)
        //图标key(2byte)名字(变长)描述(变长)
        this.kungfuNum[index] = kungfuNum;
        this.kungfuKey[index] = kungfuKey;
        this.iconKey[index] = iconKey;
        this.kungfuName[index] = kungfuName;
        this.kungfuType[index] = kungfuType;
//        Tools.printLog("1111111111111111111111111111");
//        Tools.printLog("openNum ::: " + this.openNum[index]);
//        Tools.printLog("kungfuNum ::: " + this.kungfuNum[index]);
//        Tools.printLog("kungfuKey ::: " + this.kungfuKey[index]);
//        Tools.printLog("iconKey ::: " + this.iconKey[index]);
//        Tools.printLog("kungfuName ::: " + this.kungfuName[index]);
//        Tools.printLog("kungfuDescription ::: " + this.kungfuDescription[index]);
//        Tools.printLog("222222222222222222222222222");

    }

    public void clearSkill() {
        this.imgArray = null;
        this.sArray = null;
        this.sMarqueeString = null;
        //下面的数组不能清
    }
    /**
     * 技能按键控制
     */
    private int skillindex, skillSelectindex;
    public static String strSkillKey;

    public void updateSkill() {
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }
        switch (Skill_operationTyte) {
            case Skill_interface:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    skillindex = skillindex < 35 ? (skillindex + 7) : (skillindex - 35);
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    skillindex = skillindex > 6 ? (skillindex - 7) : (skillindex + 35);
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                    skillindex = skillindex < 41 ? (skillindex + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                    skillindex = skillindex > 0 ? (skillindex - 1) : 41;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                    //跳转到漫游界面
                    if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_GAMESET_QUICKEYS) {//
                        MainLogic.getInstance().pushState(Constant.GAME_UI_GAMESET_QUICKEYS, true);
                    } else if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_HANGUP) {
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_ONLINEHANG_UI, Constant.SOCKET_MSG_TYPE_LOGIC);
                        GameBean.b_WAIT_NET_MSG_BACK = true;
                    } else {
//                        Tools.changeRoamUiSate((byte) 3, 1);
                        Tools.openRoamMenu(false, (byte) 1, (byte) 3, 1);
                    }
                    GameBean.BY_PRE_GAME_UI_STATE = -1;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定
                    if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_GAMESET_QUICKEYS) {
                        if (skillindex < 14) {
                            if (skillindex < profNum[0]) {
                                if (profType[skillindex] == 0) {
                                    GameSet.getQuickSet("" + 1, "" + proficonKey[skillindex],
                                            "" + profKey[skillindex],
                                            profName[skillindex], "",
                                            "" + 0);
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        } else if (skillindex >= 14 && skillindex < 28) {
                            if (skillindex - 14 < kungfuNum[0]) {
                                if (kungfuType[skillindex - 14] == 0) {
                                    GameSet.getQuickSet("" + 1, "" + iconKey[skillindex - 14],
                                            "" + kungfuKey[skillindex - 14],
                                            kungfuName[skillindex - 14], "",
                                            "" + 0);
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        } else if (skillindex >= 28) {
                            if (skillindex - 28 < tongNum[0]) {
                                if (tongType[skillindex - 28] == 0) {
                                    GameSet.getQuickSet("" + 1, "" + tongiconKey[skillindex - 28],
                                            "" + tongKey[skillindex - 28],
                                            tongName[skillindex - 28], "",
                                            "" + 0);
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        }
                    } else if (GameBean.BY_PRE_GAME_UI_STATE == Constant.GAME_UI_HANGUP) {
                        if (skillindex < 14) {
                            if (skillindex < profNum[0]) {
                                if (profType[skillindex] == 0) {
                                    Property.skillIcon[Property.skillSetIndex] = ResManager.createImage(proficonKey[skillindex]);
//                                    Property.skillKey[Property.skillSetIndex] = profKey[skillindex];
                                    Property.skillIndex[Property.skillSetIndex] = MainLogic.getInstance().gamePlayer.getSkillIndex(profKey[skillindex]);
                                    GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SKILL;
                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_ONLINEHANG_UI, Constant.SOCKET_MSG_TYPE_LOGIC);
                                    GameBean.b_WAIT_NET_MSG_BACK = true;
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        } else if (skillindex < 28) {
                            if (skillindex - 14 < kungfuNum[0]) {
                                if (kungfuType[skillindex - 14] == 0) {
                                    Property.skillIcon[Property.skillSetIndex] = ResManager.createImage(iconKey[skillindex - 14]);
//                                    Property.skillKey[Property.skillSetIndex] = kungfuKey[skillindex - 14];
                                    Property.skillIndex[Property.skillSetIndex] = MainLogic.getInstance().gamePlayer.getSkillIndex(kungfuKey[skillindex - 14]);
                                    GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SKILL;
                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_ONLINEHANG_UI, Constant.SOCKET_MSG_TYPE_LOGIC);
                                    GameBean.b_WAIT_NET_MSG_BACK = true;
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        } else {
                            if (skillindex - 28 < tongNum[0]) {
                                if (tongType[skillindex - 28] == 0) {
                                    Property.skillIcon[Property.skillSetIndex] = ResManager.createImage(tongiconKey[skillindex - 28]);
//                                    Property.skillKey[Property.skillSetIndex] = tongKey[skillindex - 28];
                                    Property.skillIndex[Property.skillSetIndex] = MainLogic.getInstance().gamePlayer.getSkillIndex(tongKey[skillindex - 28]);
                                    GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SKILL;
                                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_ONLINEHANG_UI, Constant.SOCKET_MSG_TYPE_LOGIC);
                                    GameBean.b_WAIT_NET_MSG_BACK = true;
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                }
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                            }
                        }
                    } else {
                        //
                        if (skillindex < 14 && skillindex < profNum.length) {
                            if (profType[skillindex] == 0) {
                                Skill_operationStr = new String[]{"查看", "快捷"};
                                isSkillactive = true;
                            } else {
                                Skill_operationStr = new String[]{"查看"};
                                isSkillactive = false;
                            }
                            Skill_operationTyte = Skill_operation;
                            skillSelectindex = 0;
                        } else if (skillindex >= 14 && skillindex < 28 && (skillindex - 14 < kungfuNum.length)) {
                            if (kungfuKey[skillindex - 14] != null) {
                                if (kungfuType[skillindex - 14] == 0) {
                                    Skill_operationStr = new String[]{"查看", "快捷", "遗忘"};
                                    isSkillactive = true;
                                } else {
                                    Skill_operationStr = new String[]{"查看", "遗忘"};
                                    isSkillactive = false;
                                }

                                Skill_operationTyte = Skill_operation;
                                skillSelectindex = 0;
                            }
                        } else if (skillindex >= 28
                                && (skillindex - 28 < tongNum.length)) {
                            if (tongType[skillindex - 28] == 0) {
                                Skill_operationStr = new String[]{"查看", "快捷", "查看", "快捷",};
                                isSkillactive = true;
                            } else {
                                Skill_operationStr = new String[]{"查看"};
                                isSkillactive = false;
                            }
                            Skill_operationTyte = Skill_operation;
                            skillSelectindex = 0;
                        }
                    }
                    //
                }
                break;
            case Skill_operation:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    skillSelectindex = skillSelectindex < (Skill_operationStr.length - 1) ? (skillSelectindex + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    skillSelectindex = skillSelectindex > 0 ? (skillSelectindex - 1) : (Skill_operationStr.length - 1);
                }
                if (skillSelectindex == 0) {//查看界面
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                        Skill_operationTyte = Skill_view;
                        if (skillindex < 14) {
                            strSkillKey = profKey[skillindex];
                        } else if (skillindex >= 14 && skillindex < 28) {
                            strSkillKey = kungfuKey[skillindex - 14];
                        } else if (skillindex >= 28) {
                            strSkillKey = tongKey[skillindex - 28];
                        }
                        GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SKILL;
                        GameBean.b_WAIT_NET_MSG_BACK = true;
                        MainLogic.getInstance().send(Constant.MSG_NET_CHECK_SKILL, Constant.SOCKET_MSG_TYPE_LOGIC);

                    }
                }
                if (!isSkillactive) {
                    if (skillSelectindex == 1) {//遗忘
                        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                            Skill_operationTyte = Skill_del;
                            delkungfu_index = 0;
                        }
                    }
                } else {
                    if (skillSelectindex == 1) {//快捷
                        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SKILL;
                            MainLogic.getInstance().pushState(Constant.GAME_UI_GAMESET_QUICKEYS, true);
                            if (skillindex < 14) {
                                if (skillindex < profNum[0]) {
                                    if (profType[skillindex] == 0) {
                                        GameSet.getSettype = "1";
                                        GameSet.getSeticon = "" + proficonKey[skillindex];
                                        GameSet.getSetid = "" + profKey[skillindex];
                                        GameSet.getSetname = profName[skillindex];
                                        GameSet.getSetdescription = "";
                                        GameSet.getSetnum = "0";
//                                        GameSet.getQuickSet("" + 1, "" + proficonKey[skillindex],
//                                                "" + profKey[skillindex],
//                                                profName[skillindex], "",
//                                                "" + 0);
                                    } else {
                                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                    }
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                                }
                            } else if (skillindex >= 14 && skillindex < 28) {
                                Tools.printLog("kungfuNum  " + kungfuNum);
                                if (skillindex - 14 < kungfuNum[0]) {
                                    if (kungfuType[skillindex - 14] == 0) {
                                        GameSet.getSettype = "1";
                                        GameSet.getSeticon = "" + iconKey[skillindex - 14];
                                        GameSet.getSetid = "" + kungfuKey[skillindex - 14];
                                        GameSet.getSetname = kungfuName[skillindex - 14];
                                        GameSet.getSetdescription = "";
                                        GameSet.getSetnum = "0";
                                    } else {
                                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                    }
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                                }
                            } else if (skillindex >= 28) {
                                if (skillindex - 28 < tongNum[0]) {
                                    if (tongType[skillindex - 28] == 0) {
                                        GameSet.getSettype = "1";
                                        GameSet.getSeticon = "" + tongiconKey[skillindex - 28];
                                        GameSet.getSetid = "" + tongKey[skillindex - 28];
                                        GameSet.getSetname = tongName[skillindex - 28];
                                        GameSet.getSetdescription = "";
                                        GameSet.getSetnum = "0";
                                    } else {
                                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "被动技能不能设置快捷!");
                                    }
                                } else {
                                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请选择技能!");
                                }
                            }
                        }
                    }
                }
                if (skillSelectindex == 2) {//遗忘
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                        Skill_operationTyte = Skill_del;
                    }
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                    Skill_operationTyte = Skill_interface;
                }
                break;
            case Skill_view:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                    Skill_operationTyte = Skill_operation;
                    skillDescription = null;
                }
                break;
            case Skill_del:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                    delkungfu_index = delkungfu_index < 1 ? (delkungfu_index + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                    delkungfu_index = delkungfu_index > 0 ? (delkungfu_index - 1) : 1;
                }
                if (delkungfu_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
                    delkungfu_id = skillindex - 14;
                    MainLogic.getInstance().send(Constant.MSG_NET_UNLEARN_SKILL, Constant.SOCKET_MSG_TYPE_LOGIC);
                }
                if (delkungfu_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
                    Skill_operationTyte = Skill_operation;
                }
                break;
        }

    }

    /**
     * 技能结束
     */
    /*******************************************************************************************/
    /**
     * 聊天开始
     */
    //画聊天
    public void drawChat(Graphics g) {
        if (this.imgArray[0] != null) {
            //#if NOKIA_S60V5
             Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                     this.imgArray[6], this.imgArray[4], this.imgArray[5], this.chatArray[0]);
             int start_Y = 41;
             int font_H = Constant.FONT_SMALL.getHeight();
             Tools.drawTilePic(g, (byte) 1, 0,
                     start_Y + font_H - this.imgArray[1].getHeight(),
                     Constant.SCREEN_WIDTH, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             g.setColor(0x000000);
             g.drawLine(0, start_Y + font_H,
                     Constant.SCREEN_WIDTH, start_Y + font_H);
 //        String[] chatoptions = {"1综", "2世", "3区", "4私", "5队", "6帮", "7系"};
             int chat_x = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(chatArray[1]) * 7) / 8;
             for (int i = 0; i < 7; i++) {
                 Tools.drawShadowString(g, (byte) 1, sArray[i], Constant.UI_START_X + chat_x
                         + (Constant.FONT_SMALL.stringWidth(chatArray[1]) + chat_x) * i,
                         Constant.UI_START_Y + start_Y, i == chatSelectindex ? 0x00E7FF : 0xFFFFFF, 0x333333);
             }
             int H = (Constant.NEW_END_LINE - start_Y - font_H * 9) / 7;
             int position = 0;
             int col = 0xffffff;
             switch (chatSelectindex) {//
                 case 0://综合
                     if (chatindex < 9) {
                         for (int i = chatStrArray.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray[i][0] != null) {
                                 switch (Integer.parseInt(MainLogic.getInstance().uiEquipment.chatStrArray[i][0])) {
                                     case 0://综合
                                         col = 0xffffff;
                                         break;
                                     case 1://世界
                                         col = 0xff7e00;
                                         break;
                                     case 2://当前
                                         col = 0xffffff;
                                         break;
                                     case 3://队伍
                                         col = 0x4eff00;
                                         break;
                                     case 4://帮派
                                         col = 0x0000ff;
                                         break;
                                     case 5://系统
                                         col = 0xefff00;
                                         break;
                                     case 6://私聊
                                         col = 0xff00f0;
                                         break;
                                 }
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray[i][6], chatStrArray[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             switch (Integer.parseInt(MainLogic.getInstance().uiEquipment.chatStrArray[i + sendchatindex - chatindex + 1][0])) {
                                 case 0://综合
                                     col = 0xffffff;
                                     break;
                                 case 1://世界
                                     col = 0xff7e00;
                                     break;
                                 case 2://当前
                                     col = 0xffffff;
                                     break;
                                 case 3://队伍
                                     col = 0x4eff00;
                                     break;
                                 case 4://帮派
                                     col = 0x0000ff;
                                     break;
                                 case 5://系统
                                     col = 0xefff00;
                                     break;
                                 case 6://私聊
                                     col = 0xff00f0;
                                     break;
                             }
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray[i + sendchatindex - chatindex + 1][6], chatStrArray[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
                 case 1://世界
                     col = 0xff7e00;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_world.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_world[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_world[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_world[i][6], chatStrArray_world[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_world[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_world[i + sendchatindex - chatindex + 1][6],
                                     chatStrArray_world[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
                 case 2://当前
                     col = 0xffffff;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_current.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_current[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_current[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_current[i][6], chatStrArray_current[i][7]);
 //                        Tools.printLog("chatStrArray_current[i][6]  ::: "+chatStrArray_current[i][6]);
 //                        Tools.printLog("chatStrArray_current[i][7]  ::: "+chatStrArray_current[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_current[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_current[i + sendchatindex - chatindex + 1][6], chatStrArray_current[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
 
                     break;
                 case 3://私聊
                     col = 0xff00f0;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_Private.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_Private[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_Private[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_Private[i][6], chatStrArray_Private[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_Private[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_Private[i + sendchatindex - chatindex + 1][6],
                                     chatStrArray_Private[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
                 case 4://队伍
                     col = 0x4eff00;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_team.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_team[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_team[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_team[i][6], chatStrArray_team[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_team[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_team[i + sendchatindex - chatindex + 1][6],
                                     chatStrArray_team[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
                 case 5://帮派
                     col = 0x0000ff;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_gang.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_gang[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_gang[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_gang[i][6], chatStrArray_gang[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_gang[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_gang[i + sendchatindex - chatindex + 1][6],
                                     chatStrArray_gang[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
                 case 6://系统
                     col = 0xefff00;
                     if (chatindex < 9) {
                         for (int i = chatStrArray_system.length - 1; i >= 0; i--) {
                             if (MainLogic.getInstance().uiEquipment.chatStrArray_system[i][0] != null) {
                                 Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_system[i][1],
                                         Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                         - (font_H + H) * (7 - position),
                                         col, 0x000000,
                                         imgArray[8], 0, 0, 15, 16, chatStrArray_system[i][6], chatStrArray_system[i][7]);
                                 position++;
                                 if (position > 7) {
                                     break;
                                 }
                             }
                         }
                     } else {
                         for (int i = 7; i >= 0; i--) {
                             Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_system[i + sendchatindex - chatindex + 1][1],
                                     Constant.UI_START_X + 5, start_Y + font_H + (font_H + H) * 7
                                     - (font_H + H) * (i),
                                     col, 0x000000,
                                     imgArray[8], 0, 0, 15, 16, chatStrArray_system[i + sendchatindex - chatindex + 1][6],
                                     chatStrArray_system[i + sendchatindex - chatindex + 1][7]);
                         }
                     }
                     break;
 
             }
             //绘制选择对话
             if (MainLogic.getInstance().byGameState != Constant.GAME_UI_CHAT_SECOND) {
                 if (chatindex > 0) {
                     if (chatindex < 9) {
                         Tools.drawTilePic(g, (byte) 1, 0,
                                 Constant.UI_START_Y + start_Y + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (chatindex - 1),
                                 Constant.SCREEN_WIDTH, this.imgArray[1],
                                 0, 0,
                                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                         g.setColor(0x000000);
                         g.drawLine(0, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (chatindex - 1),
                                 Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (chatindex - 1));
                         Tools.drawTilePic(g, (byte) 1, 0,
                                 Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (chatindex - 1),
                                 Constant.SCREEN_WIDTH, this.imgArray[1],
                                 0, 0,
                                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
                         g.setColor(0x000000);
                         g.drawLine(0, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (chatindex - 1),
                                 Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (chatindex - 1));
                     } else {
                         Tools.drawTilePic(g, (byte) 1, 0,
                                 Constant.UI_START_Y + start_Y + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (7),
                                 Constant.SCREEN_WIDTH, this.imgArray[1],
                                 0, 0,
                                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                         g.setColor(0x000000);
                         g.drawLine(0, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (7),
                                 Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (7));
                         Tools.drawTilePic(g, (byte) 1, 0,
                                 Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7),
                                 Constant.SCREEN_WIDTH, this.imgArray[1],
                                 0, 0,
                                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
                         g.setColor(0x000000);
                         g.drawLine(0, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7),
                                 Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7));
                     }
                 }
             }
            //#else
//#            Tools.drawFrame(g,
//#                    Constant.UI_START_X, Constant.UI_START_Y,
//#                    this.imgArray[2], this.imgArray[0],
//#                    this.imgArray[1],
//#                    this.imgArray[6],
//#                    0, 0, 24, 12,
//#                    this.imgArray[6], 49, 0, 23, 12,
//#                    chatArray[0], 0xFFFFFF);
//#            Tools.drawTilePic(g, (byte) 1, 0,
//#                    21,
//#                    Constant.SCREEN_WIDTH, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            g.setColor(0x000000);
//#            g.drawLine(0, 21 + this.imgArray[1].getHeight(),
//#                    Constant.SCREEN_WIDTH, 21 + this.imgArray[1].getHeight());
//#//        String[] chatoptions = {"1综", "2世", "3区", "4私", "5队", "6帮", "7系"};
//#            int chat_x = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(chatArray[1]) * 7) / 8;
//#            for (int i = 0; i < 7; i++) {
//#                Tools.drawShadowString(g, (byte) 1, sArray[i], Constant.UI_START_X + chat_x
//#                        + (Constant.FONT_SMALL.stringWidth(chatArray[1]) + chat_x) * i,
//#                        Constant.UI_START_Y + 21, i == chatSelectindex ? 0x00E7FF : 0xFFFFFF, 0x333333);
//#            }
//#            int H = (Constant.SCREEN_HEIGHT - 85 - 21 * 8) / 7;
//#            int position = 0;
//#            int col = 0xffffff;
//#            switch (chatSelectindex) {//
//#                case 0://综合
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray[i][0] != null) {
//#                                switch (Integer.parseInt(MainLogic.getInstance().uiEquipment.chatStrArray[i][0])) {
//#                                    case 0://综合
//#                                        col = 0xffffff;
//#                                        break;
//#                                    case 1://世界
//#                                        col = 0xff7e00;
//#                                        break;
//#                                    case 2://当前
//#                                        col = 0xffffff;
//#                                        break;
//#                                    case 3://队伍
//#                                        col = 0x4eff00;
//#                                        break;
//#                                    case 4://帮派
//#                                        col = 0x0000ff;
//#                                        break;
//#                                    case 5://系统
//#                                        col = 0xefff00;
//#                                        break;
//#                                    case 6://私聊
//#                                        col = 0xff00f0;
//#                                        break;
//#                                }
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray[i][6], chatStrArray[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            switch (Integer.parseInt(MainLogic.getInstance().uiEquipment.chatStrArray[i + sendchatindex - chatindex + 1][0])) {
//#                                case 0://综合
//#                                    col = 0xffffff;
//#                                    break;
//#                                case 1://世界
//#                                    col = 0xff7e00;
//#                                    break;
//#                                case 2://当前
//#                                    col = 0xffffff;
//#                                    break;
//#                                case 3://队伍
//#                                    col = 0x4eff00;
//#                                    break;
//#                                case 4://帮派
//#                                    col = 0x0000ff;
//#                                    break;
//#                                case 5://系统
//#                                    col = 0xefff00;
//#                                    break;
//#                                case 6://私聊
//#                                    col = 0xff00f0;
//#                                    break;
//#                            }
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray[i + sendchatindex - chatindex + 1][6], chatStrArray[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#                case 1://世界
//#                    col = 0xff7e00;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_world.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_world[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_world[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_world[i][6], chatStrArray_world[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_world[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_world[i + sendchatindex - chatindex + 1][6],
//#                                    chatStrArray_world[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#                case 2://当前
//#                    col = 0xffffff;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_current.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_current[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_current[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_current[i][6], chatStrArray_current[i][7]);
//#//                        Tools.printLog("chatStrArray_current[i][6]  ::: "+chatStrArray_current[i][6]);
//#//                        Tools.printLog("chatStrArray_current[i][7]  ::: "+chatStrArray_current[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_current[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_current[i + sendchatindex - chatindex + 1][6], chatStrArray_current[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#
//#                    break;
//#                case 3://私聊
//#                    col = 0xff00f0;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_Private.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_Private[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_Private[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_Private[i][6], chatStrArray_Private[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_Private[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_Private[i + sendchatindex - chatindex + 1][6],
//#                                    chatStrArray_Private[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#                case 4://队伍
//#                    col = 0x4eff00;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_team.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_team[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_team[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_team[i][6], chatStrArray_team[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_team[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_team[i + sendchatindex - chatindex + 1][6],
//#                                    chatStrArray_team[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#                case 5://帮派
//#                    col = 0x0000ff;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_gang.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_gang[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_gang[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_gang[i][6], chatStrArray_gang[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_gang[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_gang[i + sendchatindex - chatindex + 1][6],
//#                                    chatStrArray_gang[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#                case 6://系统
//#                    col = 0xefff00;
//#                    if (chatindex < 9) {
//#                        for (int i = chatStrArray_system.length - 1; i >= 0; i--) {
//#                            if (MainLogic.getInstance().uiEquipment.chatStrArray_system[i][0] != null) {
//#                                Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_system[i][1],
//#                                        Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                        - (21 + H) * (7 - position),
//#                                        col, 0x000000,
//#                                        imgArray[5], 0, 0, 15, 16, chatStrArray_system[i][6], chatStrArray_system[i][7]);
//#                                position++;
//#                                if (position > 7) {
//#                                    break;
//#                                }
//#                            }
//#                        }
//#                    } else {
//#                        for (int i = 7; i >= 0; i--) {
//#                            Tools.drawShadowString(g, MainLogic.getInstance().uiEquipment.chatStrArray_system[i + sendchatindex - chatindex + 1][1],
//#                                    Constant.UI_START_X + 5, 51 + (21 + H) * 7
//#                                    - (21 + H) * (i),
//#                                    col, 0x000000,
//#                                    imgArray[5], 0, 0, 15, 16, chatStrArray_system[i + sendchatindex - chatindex + 1][6],
//#                                    chatStrArray_system[i + sendchatindex - chatindex + 1][7]);
//#                        }
//#                    }
//#                    break;
//#
//#            }
//#            //绘制选择对话
//#            if (MainLogic.getInstance().byGameState != Constant.GAME_UI_CHAT_SECOND) {
//#
//#
//#                if (chatindex > 0) {
//#                    if (chatindex < 9) {
//#                        Tools.drawTilePic(g, (byte) 1, 0,
//#                                Constant.UI_START_Y + 51 - this.imgArray[1].getHeight() + (21 + H) * (chatindex - 1),
//#                                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                                0, 0,
//#                                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                        g.setColor(0x000000);
//#                        g.drawLine(0, Constant.UI_START_Y + 51 + (21 + H) * (chatindex - 1),
//#                                Constant.SCREEN_WIDTH, Constant.UI_START_Y + 51 + (21 + H) * (chatindex - 1));
//#                        Tools.drawTilePic(g, (byte) 1, 0,
//#                                Constant.UI_START_Y + 51 + 21 + (21 + H) * (chatindex - 1),
//#                                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                                0, 0,
//#                                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
//#                        g.setColor(0x000000);
//#                        g.drawLine(0, Constant.UI_START_Y + 51 + 21 + (21 + H) * (chatindex - 1),
//#                                Constant.SCREEN_WIDTH, Constant.UI_START_Y + 51 + 21 + (21 + H) * (chatindex - 1));
//#                    } else {
//#                        Tools.drawTilePic(g, (byte) 1, 0,
//#                                Constant.UI_START_Y + 51 - this.imgArray[1].getHeight() + (21 + H) * (7),
//#                                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                                0, 0,
//#                                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                        g.setColor(0x000000);
//#                        g.drawLine(0, Constant.UI_START_Y + 51 + (21 + H) * (7),
//#                                Constant.SCREEN_WIDTH, Constant.UI_START_Y + 51 + (21 + H) * (7));
//#                        Tools.drawTilePic(g, (byte) 1, 0,
//#                                Constant.UI_START_Y + 51 + 21 + (21 + H) * (7),
//#                                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                                0, 0,
//#                                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
//#                        g.setColor(0x000000);
//#                        g.drawLine(0, Constant.UI_START_Y + 51 + 21 + (21 + H) * (7),
//#                                Constant.SCREEN_WIDTH, Constant.UI_START_Y + 51 + 21 + (21 + H) * (7));
//#                    }
//#
//#                }
//#            }
            //#endif
        }
        MainView.drawTouchRect(g, schattouch);
    }
    private static int[][] schattouch;
    public void checkTouchChat(int x,int y) {
    	if (schattouch == null) {
	    	schattouch = new int[7][];
	    	int startx = 10;
	    	int starty = 30;
	    	int w = 333;
	    	int h = 40;
	    	int cellw = 333/7;
	    	for (int i=0;i<7;i++) {
	    		schattouch[i] = new int[]{
	    				startx + i*cellw,starty,cellw,h
	    		};
	    	}
    	}
    	int touched = MainCanvas.checkTouch(x, y, schattouch);
    	if (touched >= 0) {
    		MainCanvas.pressNum(touched+1);
    	} else {
    		MainCanvas.checkSoftKey();
    	}
    }

    public void clearChat() {
        this.imgArray = null;
        this.sArray = null;
        this.StrSelect = null;
        this.chatStrSelect = null;
        this.chatSetArray = null;
        this.strSet = null;
        this.chatStrParagraph = null;
        this.chatArray = null;
    }
    public static int chatindex, chatSelectindex;
    public static int sendchatindex;
    public static int chatshoutType;//喊话类型
    public String[] sStrArray = new String[1];
    public String[] taskORitems_ID = new String[4];//聊天中的任务或者物品的ID号,名字，类型//0代表物品1代表任务2代表宠物//物品颜色
    public String[] oldtaskORitems_ID = new String[4];
    public String taskORitems_new = "";//聊天中的任务或者物品的ID号
    public String oldtaskORitems_new = "";//聊天中的任务或者物品的ID号
    public String taskORitems_id = null, taskORitems_name = null, taskORitems_items = null, taskORitems_col = null;
    public static final int chatline_num = 20;
    public String[][] chatStrArray = new String[chatline_num][8];//综合//喊话类型,喊话内容,喊话人,接收人,喊话人ID//聊天中的任务或者物品的ID号,名字，类型//0代表物品1代表任务
//   [综]", "[世]", "[当]", "[队]", "[帮]", "[系]", "[私]
    public String[][] chatStrArray_world = new String[chatline_num][8];//世界
    public String[][] chatStrArray_current = new String[chatline_num][8];//当前
    public String[][] chatStrArray_team = new String[chatline_num][8];//队伍
    public String[][] chatStrArray_gang = new String[chatline_num][8];//帮派
    public String[][] chatStrArray_system = new String[chatline_num][8];//系统
    public String[][] chatStrArray_Private = new String[chatline_num][8];//私聊
    public String oldword = "";
    public String OtherPlayer;
    public static String chatOtherplayerName = "";//私聊对象
    public static long chatOtherplayerId;//私聊对象ID

    public void getshoutTypeChatStr(String shoutType, String str, String send_p, String receive_p,
            String send_id, String taskORitems_id, String taskORitems_name, String taskORitems_items) {
        switch (Integer.parseInt(shoutType)) {
            case 0://综合
                break;
            case 1://世界
                if (chatStrArray_world[chatStrArray_world.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_world.length; j++) {
                        newchat[j][0] = chatStrArray_world[j][0];
                        newchat[j][1] = chatStrArray_world[j][1];
                        newchat[j][2] = chatStrArray_world[j][2];
                        newchat[j][3] = chatStrArray_world[j][3];
                        newchat[j][4] = chatStrArray_world[j][4];
                        newchat[j][5] = chatStrArray_world[j][5];
                        newchat[j][6] = chatStrArray_world[j][6];
                        newchat[j][7] = chatStrArray_world[j][7];
                    }
                    for (int a = 0; a < chatStrArray_world.length - 1; a++) {
                        chatStrArray_world[a][0] = newchat[a + 1][0];
                        chatStrArray_world[a][1] = newchat[a + 1][1];
                        chatStrArray_world[a][2] = newchat[a + 1][2];
                        chatStrArray_world[a][3] = newchat[a + 1][3];
                        chatStrArray_world[a][4] = newchat[a + 1][4];
                        chatStrArray_world[a][5] = newchat[a + 1][5];
                        chatStrArray_world[a][6] = newchat[a + 1][6];
                        chatStrArray_world[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_world[chatStrArray_world.length - 1][0] = shoutType;
                    chatStrArray_world[chatStrArray_world.length - 1][1] = str;
                    chatStrArray_world[chatStrArray_world.length - 1][2] = send_p;
                    chatStrArray_world[chatStrArray_world.length - 1][3] = receive_p;
                    chatStrArray_world[chatStrArray_world.length - 1][4] = send_id;
                    chatStrArray_world[chatStrArray_world.length - 1][5] = taskORitems_id;
                    chatStrArray_world[chatStrArray_world.length - 1][6] = taskORitems_name;
                    chatStrArray_world[chatStrArray_world.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_world.length; i++) {
                        if (chatStrArray_world[i][0] == null) {
                            chatStrArray_world[i][0] = shoutType;
                            chatStrArray_world[i][1] = str;
                            chatStrArray_world[i][2] = send_p;
                            chatStrArray_world[i][3] = receive_p;
                            chatStrArray_world[i][4] = send_id;
                            chatStrArray_world[i][5] = taskORitems_id;
                            chatStrArray_world[i][6] = taskORitems_name;
                            chatStrArray_world[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
            case 2://当前
                if (chatStrArray_current[chatStrArray_current.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_current.length; j++) {
                        newchat[j][0] = chatStrArray_current[j][0];
                        newchat[j][1] = chatStrArray_current[j][1];
                        newchat[j][2] = chatStrArray_current[j][2];
                        newchat[j][3] = chatStrArray_current[j][3];
                        newchat[j][4] = chatStrArray_current[j][4];
                        newchat[j][5] = chatStrArray_current[j][5];
                        newchat[j][6] = chatStrArray_current[j][6];
                        newchat[j][7] = chatStrArray_current[j][7];
                    }
                    for (int a = 0; a < chatStrArray_current.length - 1; a++) {
                        chatStrArray_current[a][0] = newchat[a + 1][0];
                        chatStrArray_current[a][1] = newchat[a + 1][1];
                        chatStrArray_current[a][2] = newchat[a + 1][2];
                        chatStrArray_current[a][3] = newchat[a + 1][3];
                        chatStrArray_current[a][4] = newchat[a + 1][4];
                        chatStrArray_current[a][5] = newchat[a + 1][5];
                        chatStrArray_current[a][6] = newchat[a + 1][6];
                        chatStrArray_current[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_current[chatStrArray_current.length - 1][0] = shoutType;
                    chatStrArray_current[chatStrArray_current.length - 1][1] = str;
                    chatStrArray_current[chatStrArray_current.length - 1][2] = send_p;
                    chatStrArray_current[chatStrArray_current.length - 1][3] = receive_p;
                    chatStrArray_current[chatStrArray_current.length - 1][4] = send_id;
                    chatStrArray_current[chatStrArray_current.length - 1][5] = taskORitems_id;
                    chatStrArray_current[chatStrArray_current.length - 1][6] = taskORitems_name;
                    chatStrArray_current[chatStrArray_current.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_current.length; i++) {
                        if (chatStrArray_current[i][0] == null) {
                            chatStrArray_current[i][0] = shoutType;
                            chatStrArray_current[i][1] = str;
                            chatStrArray_current[i][2] = send_p;
                            chatStrArray_current[i][3] = receive_p;
                            chatStrArray_current[i][4] = send_id;
                            chatStrArray_current[i][5] = taskORitems_id;
                            chatStrArray_current[i][6] = taskORitems_name;
                            chatStrArray_current[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
            case 3://队伍
                if (chatStrArray_team[chatStrArray_team.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_team.length; j++) {
                        newchat[j][0] = chatStrArray_team[j][0];
                        newchat[j][1] = chatStrArray_team[j][1];
                        newchat[j][2] = chatStrArray_team[j][2];
                        newchat[j][3] = chatStrArray_team[j][3];
                        newchat[j][4] = chatStrArray_team[j][4];
                        newchat[j][5] = chatStrArray_team[j][5];
                        newchat[j][6] = chatStrArray_team[j][6];
                        newchat[j][7] = chatStrArray_team[j][7];
                    }
                    for (int a = 0; a < chatStrArray_team.length - 1; a++) {
                        chatStrArray_team[a][0] = newchat[a + 1][0];
                        chatStrArray_team[a][1] = newchat[a + 1][1];
                        chatStrArray_team[a][2] = newchat[a + 1][2];
                        chatStrArray_team[a][3] = newchat[a + 1][3];
                        chatStrArray_team[a][4] = newchat[a + 1][4];
                        chatStrArray_team[a][5] = newchat[a + 1][5];
                        chatStrArray_team[a][6] = newchat[a + 1][6];
                        chatStrArray_team[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_team[chatStrArray_team.length - 1][0] = shoutType;
                    chatStrArray_team[chatStrArray_team.length - 1][1] = str;
                    chatStrArray_team[chatStrArray_team.length - 1][2] = send_p;
                    chatStrArray_team[chatStrArray_team.length - 1][3] = receive_p;
                    chatStrArray_team[chatStrArray_team.length - 1][4] = send_id;
                    chatStrArray_team[chatStrArray_team.length - 1][5] = taskORitems_id;
                    chatStrArray_team[chatStrArray_team.length - 1][6] = taskORitems_name;
                    chatStrArray_team[chatStrArray_team.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_team.length; i++) {
                        if (chatStrArray_team[i][0] == null) {
                            chatStrArray_team[i][0] = shoutType;
                            chatStrArray_team[i][1] = str;
                            chatStrArray_team[i][2] = send_p;
                            chatStrArray_team[i][3] = receive_p;
                            chatStrArray_team[i][4] = send_id;
                            chatStrArray_team[i][5] = taskORitems_id;
                            chatStrArray_team[i][6] = taskORitems_name;
                            chatStrArray_team[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
            case 4://帮派
                if (chatStrArray_gang[chatStrArray_gang.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_gang.length; j++) {
                        newchat[j][0] = chatStrArray_gang[j][0];
                        newchat[j][1] = chatStrArray_gang[j][1];
                        newchat[j][2] = chatStrArray_gang[j][2];
                        newchat[j][3] = chatStrArray_gang[j][3];
                        newchat[j][4] = chatStrArray_gang[j][4];
                        newchat[j][5] = chatStrArray_gang[j][5];
                        newchat[j][6] = chatStrArray_gang[j][6];
                        newchat[j][7] = chatStrArray_gang[j][7];
                    }
                    for (int a = 0; a < chatStrArray_gang.length - 1; a++) {
                        chatStrArray_gang[a][0] = newchat[a + 1][0];
                        chatStrArray_gang[a][1] = newchat[a + 1][1];
                        chatStrArray_gang[a][2] = newchat[a + 1][2];
                        chatStrArray_gang[a][3] = newchat[a + 1][3];
                        chatStrArray_gang[a][4] = newchat[a + 1][4];
                        chatStrArray_gang[a][5] = newchat[a + 1][5];
                        chatStrArray_gang[a][6] = newchat[a + 1][6];
                        chatStrArray_gang[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_gang[chatStrArray_gang.length - 1][0] = shoutType;
                    chatStrArray_gang[chatStrArray_gang.length - 1][1] = str;
                    chatStrArray_gang[chatStrArray_gang.length - 1][2] = send_p;
                    chatStrArray_gang[chatStrArray_gang.length - 1][3] = receive_p;
                    chatStrArray_gang[chatStrArray_gang.length - 1][4] = send_id;
                    chatStrArray_gang[chatStrArray_gang.length - 1][5] = taskORitems_id;
                    chatStrArray_gang[chatStrArray_gang.length - 1][6] = taskORitems_name;
                    chatStrArray_gang[chatStrArray_gang.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_gang.length; i++) {
                        if (chatStrArray_gang[i][0] == null) {
                            chatStrArray_gang[i][0] = shoutType;
                            chatStrArray_gang[i][1] = str;
                            chatStrArray_gang[i][2] = send_p;
                            chatStrArray_gang[i][3] = receive_p;
                            chatStrArray_gang[i][4] = send_id;
                            chatStrArray_gang[i][5] = taskORitems_id;
                            chatStrArray_gang[i][6] = taskORitems_name;
                            chatStrArray_gang[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
            case 5://系统
                if (chatStrArray_system[chatStrArray_system.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_system.length; j++) {
                        newchat[j][0] = chatStrArray_system[j][0];
                        newchat[j][1] = chatStrArray_system[j][1];
                        newchat[j][2] = chatStrArray_system[j][2];
                        newchat[j][3] = chatStrArray_system[j][3];
                        newchat[j][4] = chatStrArray_system[j][4];
                        newchat[j][5] = chatStrArray_system[j][5];
                        newchat[j][6] = chatStrArray_system[j][6];
                        newchat[j][7] = chatStrArray_system[j][7];
                    }
                    for (int a = 0; a < chatStrArray_system.length - 1; a++) {
                        chatStrArray_system[a][0] = newchat[a + 1][0];
                        chatStrArray_system[a][1] = newchat[a + 1][1];
                        chatStrArray_system[a][2] = newchat[a + 1][2];
                        chatStrArray_system[a][3] = newchat[a + 1][3];
                        chatStrArray_system[a][4] = newchat[a + 1][4];
                        chatStrArray_system[a][5] = newchat[a + 1][5];
                        chatStrArray_system[a][6] = newchat[a + 1][6];
                        chatStrArray_system[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_system[chatStrArray_system.length - 1][0] = shoutType;
                    chatStrArray_system[chatStrArray_system.length - 1][1] = str;
                    chatStrArray_system[chatStrArray_system.length - 1][2] = send_p;
                    chatStrArray_system[chatStrArray_system.length - 1][3] = receive_p;
                    chatStrArray_system[chatStrArray_system.length - 1][4] = send_id;
                    chatStrArray_system[chatStrArray_system.length - 1][5] = taskORitems_id;
                    chatStrArray_system[chatStrArray_system.length - 1][6] = taskORitems_name;
                    chatStrArray_system[chatStrArray_system.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_system.length; i++) {
                        if (chatStrArray_system[i][0] == null) {
                            chatStrArray_system[i][0] = shoutType;
                            chatStrArray_system[i][1] = str;
                            chatStrArray_system[i][2] = send_p;
                            chatStrArray_system[i][3] = receive_p;
                            chatStrArray_system[i][4] = send_id;
                            chatStrArray_system[i][5] = taskORitems_id;
                            chatStrArray_system[i][6] = taskORitems_name;
                            chatStrArray_system[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
            case 6://私聊
                if (chatStrArray_Private[chatStrArray_Private.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < chatStrArray_Private.length; j++) {
                        newchat[j][0] = chatStrArray_Private[j][0];
                        newchat[j][1] = chatStrArray_Private[j][1];
                        newchat[j][2] = chatStrArray_Private[j][2];
                        newchat[j][3] = chatStrArray_Private[j][3];
                        newchat[j][4] = chatStrArray_Private[j][4];
                        newchat[j][5] = chatStrArray_Private[j][5];
                        newchat[j][6] = chatStrArray_Private[j][6];
                        newchat[j][7] = chatStrArray_Private[j][7];
                    }
                    for (int a = 0; a < chatStrArray_Private.length - 1; a++) {
                        chatStrArray_Private[a][0] = newchat[a + 1][0];
                        chatStrArray_Private[a][1] = newchat[a + 1][1];
                        chatStrArray_Private[a][2] = newchat[a + 1][2];
                        chatStrArray_Private[a][3] = newchat[a + 1][3];
                        chatStrArray_Private[a][4] = newchat[a + 1][4];
                        chatStrArray_Private[a][5] = newchat[a + 1][5];
                        chatStrArray_Private[a][6] = newchat[a + 1][6];
                        chatStrArray_Private[a][7] = newchat[a + 1][7];
                    }
                    chatStrArray_Private[chatStrArray_Private.length - 1][0] = shoutType;
                    chatStrArray_Private[chatStrArray_Private.length - 1][1] = str;
                    chatStrArray_Private[chatStrArray_Private.length - 1][2] = send_p;
                    chatStrArray_Private[chatStrArray_Private.length - 1][3] = receive_p;
                    chatStrArray_Private[chatStrArray_Private.length - 1][4] = send_id;
                    chatStrArray_Private[chatStrArray_Private.length - 1][5] = taskORitems_id;
                    chatStrArray_Private[chatStrArray_Private.length - 1][6] = taskORitems_name;
                    chatStrArray_Private[chatStrArray_Private.length - 1][7] = taskORitems_items;
                } else {
                    for (int i = 0; i < chatStrArray_Private.length; i++) {
                        if (chatStrArray_Private[i][0] == null) {
                            chatStrArray_Private[i][0] = shoutType;
                            chatStrArray_Private[i][1] = str;
                            chatStrArray_Private[i][2] = send_p;
                            chatStrArray_Private[i][3] = receive_p;
                            chatStrArray_Private[i][4] = send_id;
                            chatStrArray_Private[i][5] = taskORitems_id;
                            chatStrArray_Private[i][6] = taskORitems_name;
                            chatStrArray_Private[i][7] = taskORitems_items;
                            break;
                        }
                    }
                }
                break;
        }
    }

    public void getChatInformation(long playerID, String otherPlayer, byte shoutType, String shoutContent) {
        //发起人ID(8byte)发起人alias(变长)喊话类型(byte)喊话内容(变长)
//        System.out.println("MainLogic.getInstance().uiEquipment.chatSet[6]   "+MainLogic.getInstance().uiEquipment.chatSet[6]);
//        System.out.println("playerID   "+playerID);
        if (MainLogic.getInstance().uiEquipment.chatSet[6] == 1 && playerID == 100) {
            MainLogic.getInstance().uiInterFace.uichat_index = 100;
            return;
        }
        OtherPlayer = otherPlayer;//其他玩家
        shoutContent = strtaskORitems(shoutContent);
        String[] chathead = {"[综]", "[世]", "[区]", "[队]", "[帮]", "[系]", "[私]"};
        if (shoutType == 6) {
            chatOtherplayerName = otherPlayer;
            chatOtherplayerId = playerID;
            GameBean.BY_CMD_FRIEND_ID = playerID;
            MainLogic.getInstance().uiEquipment.changeParagraph(chathead[shoutType]
                    + OtherPlayer
                    + "对" + MainLogic.getInstance().gamePlayer.sPlayerName + "：" + shoutContent,
                    Constant.SCREEN_WIDTH - 10, 2);
            //#if NOKIA_S60V5
             MainLogic.getInstance().uiEquipment.changeNokiaParagraph(chathead[shoutType]
                     + OtherPlayer
                     + "对" + MainLogic.getInstance().gamePlayer.sPlayerName + "：" + shoutContent,
                     MainLogic.getInstance().uiInterFace.UIchat_W, 2);
            //#endif
            Tools.printLog("对方跟我私聊");
            //MainLogic.getInstance().send(Constant.MSG_NET_CMD_ADD_CONTANT, Constant.SOCKET_MSG_TYPE_LOGIC);
            GameBean.BY_CMD_FRIEND_NAME = chatOtherplayerName;
            GameBean.BY_CMD_FRIEND_TYPE = 4;
            GameBean.BY_CMD_FRIEND_MODE = 2;
            MainLogic.getInstance().send(Constant.MSG_NET_CMD_ADD_FRIEND, Constant.SOCKET_MSG_TYPE_LOGIC);
        } else {
            MainLogic.getInstance().uiEquipment.changeParagraph(chathead[shoutType]
                    + OtherPlayer
                    + "：" + shoutContent,
                    Constant.SCREEN_WIDTH - 10, 2);
            //#if NOKIA_S60V5
             MainLogic.getInstance().uiEquipment.changeNokiaParagraph(chathead[shoutType]
                     + OtherPlayer
                     + "：" + shoutContent,
                     MainLogic.getInstance().uiInterFace.UIchat_W, 2);
            //#endif
        }
//        for (int k = 0; k < MainLogic.getInstance().uiEquipment.chatStrParagraph.length; k++) {
        for (int k = MainLogic.getInstance().uiEquipment.chatStrParagraph.length - 1; k >= 0; k--) {
            if (MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0] != null) {
                if (MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][0] != null) {
                    String[][] newchat = new String[chatline_num][8];
                    for (int j = 0; j < MainLogic.getInstance().uiEquipment.chatStrArray.length; j++) {
                        newchat[j][0] = MainLogic.getInstance().uiEquipment.chatStrArray[j][0];
                        newchat[j][1] = MainLogic.getInstance().uiEquipment.chatStrArray[j][1];
                        newchat[j][2] = MainLogic.getInstance().uiEquipment.chatStrArray[j][2];
                        newchat[j][3] = MainLogic.getInstance().uiEquipment.chatStrArray[j][3];
                        newchat[j][4] = MainLogic.getInstance().uiEquipment.chatStrArray[j][4];
                        newchat[j][5] = MainLogic.getInstance().uiEquipment.chatStrArray[j][5];
                        newchat[j][6] = MainLogic.getInstance().uiEquipment.chatStrArray[j][6];
                        newchat[j][7] = MainLogic.getInstance().uiEquipment.chatStrArray[j][7];
                    }
                    for (int a = 0; a < MainLogic.getInstance().uiEquipment.chatStrArray.length - 1; a++) {
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][0] = newchat[a + 1][0];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][1] = newchat[a + 1][1];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][2] = newchat[a + 1][2];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][3] = newchat[a + 1][3];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][4] = newchat[a + 1][4];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][5] = newchat[a + 1][5];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][6] = newchat[a + 1][6];
                        MainLogic.getInstance().uiEquipment.chatStrArray[a][7] = newchat[a + 1][7];
                    }
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][0] = ""
                            + shoutType;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][1] = MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0];
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][2] = OtherPlayer;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][3] = MainLogic.getInstance().gamePlayer.sPlayerName;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][4] = "" + playerID;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][5] = taskORitems_id;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][6] = taskORitems_name;
                    MainLogic.getInstance().uiEquipment.chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][7] = taskORitems_items;
                    MainLogic.getInstance().uiEquipment.getshoutTypeChatStr(
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][0],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][1],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][2],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][3],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][4],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][5],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][6],
                            chatStrArray[MainLogic.getInstance().uiEquipment.chatStrArray.length - 1][7]);
                } else {
                    for (int i = 0; i < MainLogic.getInstance().uiEquipment.chatStrArray.length; i++) {
                        if (MainLogic.getInstance().uiEquipment.chatStrArray[i][0] == null) {
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][0] = ""
                                    + shoutType;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][1] = MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0];
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][2] = OtherPlayer;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][3] = MainLogic.getInstance().gamePlayer.sPlayerName;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][4] = "" + playerID;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][5] = taskORitems_id;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][6] = taskORitems_name;
                            MainLogic.getInstance().uiEquipment.chatStrArray[i][7] = taskORitems_items;
                            MainLogic.getInstance().uiEquipment.getshoutTypeChatStr(chatStrArray[i][0], chatStrArray[i][1],
                                    chatStrArray[i][2], chatStrArray[i][3], chatStrArray[i][4], chatStrArray[i][5],
                                    chatStrArray[i][6], chatStrArray[i][7]);
                            break;
                        }
                    }
                }
            }
        }
        if (shoutType == 5) {
            getSysUIchat(shoutType, taskORitems_name, taskORitems_items);
        } else {
            getUIchat(shoutType, taskORitems_name, taskORitems_items);
        }
//        Tools.printLog(" wwwwwwwwwwwwwwwwwwwwwwwwwww");
    }
    //
    //#if NOKIA_S60V5
 
     public void getSysUIchat(byte shoutType, String taskORitems_name1, String taskORitems_items1) {
         MainLogic.getInstance().uiInterFace.uiSyschat_index = 0;
         for (int k = 0; k < MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph.length - 1; k++) {
             if (MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph[k][0] != null) {
                 for (int i = 0; i < MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length; i++) {
                     if (MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][0] == null) {
                         MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][0] = "" + shoutType;
                         MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][1] = MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph[k][0];
                         MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][2] = taskORitems_name1;
                         MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][3] = taskORitems_items1;
                         MainLogic.getInstance().uiInterFace.uiSyschatline_num = i + 1;
                         MainLogic.getInstance().uiInterFace.uiSyschatStrArray = resizeArray(MainLogic.getInstance().uiInterFace.uiSyschatStrArray);
                         break;
                     }
                 }
             }
         }
         if (MainLogic.getInstance().uiInterFace.uiSyschatTime_index < 0) {
             MainLogic.getInstance().uiInterFace.uiSyschatTime_index = 0;
         }
         MainLogic.getInstance().uiInterFace.uiSyschatTime_num = MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length - 2;
 //        if (MainLogic.getInstance().uiInterFace.uichatStrArray.length  > 4) {
 //            MainLogic.getInstance().uiInterFace.uichatTime_index = MainLogic.getInstance().uiInterFace.uichatStrArray.length - 4;
 //            MainLogic.getInstance().uiInterFace.uichatTime_num = 3;
 //        }
     }
 
     public void getUIchat(byte shoutType, String taskORitems_name1, String taskORitems_items1) {
         MainLogic.getInstance().uiInterFace.uichat_index = 0;
         for (int k = 0; k < MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph.length - 1; k++) {
             if (MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph[k][0] != null) {
                 for (int i = 0; i < MainLogic.getInstance().uiInterFace.uichatStrArray.length; i++) {
                     if (MainLogic.getInstance().uiInterFace.uichatStrArray[i][0] == null) {
                         MainLogic.getInstance().uiInterFace.uichatStrArray[i][0] = "" + shoutType;
                         MainLogic.getInstance().uiInterFace.uichatStrArray[i][1] = MainLogic.getInstance().uiEquipment.chatStrNokiaParagraph[k][0];
                         MainLogic.getInstance().uiInterFace.uichatStrArray[i][2] = taskORitems_name1;
                         MainLogic.getInstance().uiInterFace.uichatStrArray[i][3] = taskORitems_items1;
                         MainLogic.getInstance().uiInterFace.uichatline_num = i + 1;
                         if (MainLogic.getInstance().uiInterFace.uichatline_num > 3) {
                             MainLogic.getInstance().uiInterFace.uichatline_num = 3;
                         }
                         MainLogic.getInstance().uiInterFace.uichatStrArray = resizeArray(MainLogic.getInstance().uiInterFace.uichatStrArray);
                         break;
                     }
                 }
             }
         }
         if (MainLogic.getInstance().uiInterFace.uichatTime_index < 0) {
             MainLogic.getInstance().uiInterFace.uichatTime_index = 0;
         }
         if (MainLogic.getInstance().uiInterFace.uichatStrArray.length > 4) {
             MainLogic.getInstance().uiInterFace.uichatTime_index = MainLogic.getInstance().uiInterFace.uichatStrArray.length - 4;
             MainLogic.getInstance().uiInterFace.uichatTime_num = 3;
 //            MainLogic.getInstance().uiInterFace.uichatTime_num = MainLogic.getInstance().uiInterFace.uichatStrArray.length - 1 - 4;
 //            Tools.printLog("uichatTime_num    " + MainLogic.getInstance().uiInterFace.uichatTime_num);
 //            Tools.printLog("uichatStrArray    " + MainLogic.getInstance().uiInterFace.uichatStrArray.length);
         }
     }
    //#else
//#
//#    public void getSysUIchat(byte shoutType, String taskORitems_name1, String taskORitems_items1) {
//#        MainLogic.getInstance().uiInterFace.uiSyschat_index = 0;
//#        for (int k = 0; k < MainLogic.getInstance().uiEquipment.chatStrParagraph.length - 1; k++) {
//#            if (MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0] != null) {
//#                for (int i = 0; i < MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length; i++) {
//#                    if (MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][0] == null) {
//#                        MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][0] = "" + shoutType;
//#                        MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][1] = MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0];
//#                        MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][2] = taskORitems_name1;
//#//                        System.out.println("taskORitems_name  "+taskORitems_name1);
//#                        MainLogic.getInstance().uiInterFace.uiSyschatStrArray[i][3] = taskORitems_items1;
//#                        MainLogic.getInstance().uiInterFace.uiSyschatline_num = i + 1;
//#                        MainLogic.getInstance().uiInterFace.uiSyschatStrArray = resizeArray(MainLogic.getInstance().uiInterFace.uiSyschatStrArray);
//#                        break;
//#                    }
//#                }
//#            }
//#        }
//#        if (MainLogic.getInstance().uiInterFace.uiSyschatTime_index < 0) {
//#            MainLogic.getInstance().uiInterFace.uiSyschatTime_index = 0;
//#        }
//#//        if (MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length > 4) {
//#//            MainLogic.getInstance().uiInterFace.uichatTime_index = MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length - 1;
//#//            MainLogic.getInstance().uiInterFace.uichatTime_num = 3;
//#        MainLogic.getInstance().uiInterFace.uiSyschatTime_num = MainLogic.getInstance().uiInterFace.uiSyschatStrArray.length - 2;
//#//        }
//#    }
//#
//#    public void getUIchat(byte shoutType, String taskORitems_name1, String taskORitems_items1) {
//#        MainLogic.getInstance().uiInterFace.uichat_index = 0;
//#        for (int k = 0; k < MainLogic.getInstance().uiEquipment.chatStrParagraph.length - 1; k++) {
//#            if (MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0] != null) {
//#                for (int i = 0; i < MainLogic.getInstance().uiInterFace.uichatStrArray.length; i++) {
//#                    if (MainLogic.getInstance().uiInterFace.uichatStrArray[i][0] == null) {
//#                        MainLogic.getInstance().uiInterFace.uichatStrArray[i][0] = "" + shoutType;
//#                        MainLogic.getInstance().uiInterFace.uichatStrArray[i][1] = MainLogic.getInstance().uiEquipment.chatStrParagraph[k][0];
//#                        MainLogic.getInstance().uiInterFace.uichatStrArray[i][2] = taskORitems_name1;
//#//                        System.out.println("taskORitems_name  "+taskORitems_name1);
//#                        MainLogic.getInstance().uiInterFace.uichatStrArray[i][3] = taskORitems_items1;
//#                        MainLogic.getInstance().uiInterFace.uichatline_num = i + 1;
//#                        if (MainLogic.getInstance().uiInterFace.uichatline_num > 3) {
//#                            MainLogic.getInstance().uiInterFace.uichatline_num = 3;
//#                        }
//#                        MainLogic.getInstance().uiInterFace.uichatStrArray = resizeArray(MainLogic.getInstance().uiInterFace.uichatStrArray);
//#                        break;
//#                    }
//#                }
//#            }
//#        }
//#        if (MainLogic.getInstance().uiInterFace.uichatTime_index < 0) {
//#            MainLogic.getInstance().uiInterFace.uichatTime_index = 0;
//#        }
//#        if (MainLogic.getInstance().uiInterFace.uichatStrArray.length > 4) {
//#            MainLogic.getInstance().uiInterFace.uichatTime_index = MainLogic.getInstance().uiInterFace.uichatStrArray.length - 4;
//#            MainLogic.getInstance().uiInterFace.uichatTime_num = 3;
//#//            MainLogic.getInstance().uiInterFace.uichatTime_num = MainLogic.getInstance().uiInterFace.uichatStrArray.length - 1 - 4;
//#        }
//#    }
    //#endif
    //改变数组大小

    public String[][] resizeArray(String[][] array) {
        int len = array.length;
        String[][] tmp = array;
        array = new String[len + 1][4];
        for (int i = 0; i < len; i++) {
            System.arraycopy(tmp[i], 0, array[i], 0, 4);
        }
        return array;
    }
    public static String[][] chatStrParagraph = null;

    public String strtaskORitems(String str) {
        Tools.printLog("str ::: " + str);
        char tempChar,
                tempChar1 = ' ';
        int tempnum0 = -1,
                tempnum1 = -1,
                tempnum2 = -1,
                tempnum3 = -1,
                tempnum4 = -1,
                tempnum5 = -1;

        boolean head1 = false,
                head2 = false,
                head3 = false,
                head4 = false,
                head5 = false,
                head6 = false;
//                    if (ss.indexOf("/%") != -1) {
//                    for (int i = ss.indexOf("/%") + 2; i < ss.length(); i++) {
        for (int i = 0; i < str.length(); i++) {
            tempChar = str.charAt(i);
            if (i < str.length() - 1) {
                tempChar1 = str.charAt(i + 1);
            }
            if (tempChar == '/') {
                if (tempChar1 == '%') {
                    tempnum0 = i;
                    head1 = true;
//                    Tools.printLog("tempnum0 : " + tempnum0);
                }
            }
            if (tempChar == '*' && head1) {
                tempnum1 = i;
                head1 = false;
//                Tools.printLog("tempnum1 : " + tempnum1);
                if (tempnum1 == tempnum0 + 2) {
                    head2 = true;
                }
            }
            if (tempChar == '<' && head2) {
                tempnum2 = i;
                head2 = false;
//                Tools.printLog("tempnum2 : " + tempnum2);
//                if (tempnum2 == tempnum1 + 5) {
                head3 = true;
//                }
            }
            if (tempChar == '>' && head3) {
                tempnum3 = i;
                head3 = false;
                head4 = true;
            }
            if (tempChar == '$' && head4) {
                tempnum4 = i;
                head4 = false;
                head5 = true;
            }
            if (tempChar == '@' && head5) {
                tempnum5 = i;
                head5 = false;
                head6 = true;
                break;
            }
        }
        if (head6) {
            Tools.printLog("aa ::: " + str.substring(0, tempnum0 + 2));
            Tools.printLog("taskORitems_id ::: " + str.substring(tempnum1 + 1, tempnum2));
            Tools.printLog("taskORitems_name ::: " + str.substring(tempnum2 + 1, tempnum3));
            Tools.printLog("taskORitems_items ::: " + str.substring(tempnum3 + 1, tempnum4));
            Tools.printLog("taskORitems_col ::: " + str.substring(tempnum4 + 1, tempnum5));
            taskORitems_id = str.substring(tempnum1 + 1, tempnum2);
            taskORitems_name = str.substring(tempnum2 + 1, tempnum3);
            taskORitems_items = str.substring(tempnum3 + 1, tempnum4);
            taskORitems_col = str.substring(tempnum4 + 1, tempnum5);
            taskORitems_name = taskORitems_col + taskORitems_name;
            str = str.substring(0, tempnum0 + 2)
                    + str.substring(tempnum4 + 1, tempnum5)
                    + str.substring(tempnum2 + 1, tempnum3)
                    + str.substring(tempnum5 + 1, str.length());
            Tools.printLog("ss ::: " + str);
//            /%*<呵呵>$2@
            return str;
        } else {
            return str;
        }
    }
    ///////////////////////////////////////

    public void changeParagraph(String text, int lineWidth, int startX) {
        int length = text.length();
        char tempChar, tempChar1 = ' ';
        int tempLength = 0;
        int charWidth;
        int iStartX = startX;
        chatStrParagraph = new String[6][1];
        String temp;
        int pos = 0;
        int line = 1;
        for (int i = 0; i < length; i++) {
            tempChar = text.charAt(i);
            if (i < length - 1) {
                tempChar1 = text.charAt(i + 1);
            }
            if (tempChar == '/') {
                if (tempChar1 == '1'
                        || tempChar1 == '2'
                        || tempChar1 == '3'
                        || tempChar1 == '4'
                        || tempChar1 == '5'
                        || tempChar1 == '6'
                        || tempChar1 == '7'
                        || tempChar1 == '8'
                        || tempChar1 == '9'
                        || tempChar1 == '0'
                        || tempChar1 == '*'
                        || tempChar1 == '#') {
                    int charTwo = 0;
                    if (tempChar1 == '*') {
                        charTwo = Constant.FONT_SMALL.stringWidth("/*0");
                    } else {
                        charTwo = Constant.FONT_SMALL.stringWidth("/10");
                    }
                    if (tempLength + 15 > lineWidth) {
                        line += 1;
                        pos = i;
                        iStartX = startX;
                        iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
                        tempLength = Constant.FONT_SMALL.charWidth(tempChar);
//                        Tools.printLog("1111111111111111111111111111");
                    }
                    tempLength = tempLength + 15 - charTwo;
                    iStartX = iStartX + 15 - charTwo;

                } else if (tempChar1 == '%') {
                    int charTwo = Constant.FONT_SMALL.stringWidth("/%5");
                    //去掉图片显示
//                    int charTwo = charTwo = Constant.FONT_SMALL.stringWidth("/%");
//                    Tools.printLog("ccccccccccccccccccccccccccccccccccccccccccccccccc");
//                    if (tempLength + 30 > lineWidth) {//去掉图片显示
//                        line += 1;
//                        pos = i;
//                        iStartX = startX;
//                        iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
//                        tempLength = Constant.FONT_SMALL.charWidth(tempChar);
//                    }
                    //去掉图片显示
                    tempLength = tempLength - charTwo;
                    iStartX = iStartX - charTwo;
//                    tempLength = tempLength + 30 - charTwo;
//                    iStartX = iStartX + 30 - charTwo;
                }
            }
            charWidth = Constant.FONT_SMALL.charWidth(tempChar);
            temp = text.substring(pos, i + 1);
            chatStrParagraph[line][0] = temp;
            if (tempLength + charWidth <= lineWidth) {
                tempLength = tempLength + charWidth;
                iStartX = iStartX + charWidth;
            } else {
                temp = text.substring(pos, i);
                chatStrParagraph[line][0] = temp;
                line += 1;
                pos = i;
                iStartX = startX;
                iStartX = iStartX + charWidth;
                tempLength = charWidth;
            }
        }
//        for (int i = 0; i < chatStrParagraph.length; i++) {
//            if (chatStrParagraph[i][0] != null) {
//                Tools.printLog("VV :: " + chatStrParagraph[i][0]);
//            }
//        }
    }
/////////////////////////////////////////////////////////////////////////////////////
    //#if NOKIA_S60V5
     public static String[][] chatStrNokiaParagraph = null;
 
     public void changeNokiaParagraph(String text, int lineWidth, int startX) {
         int length = text.length();
         char tempChar, tempChar1 = ' ';
         int tempLength = 0;
         int charWidth;
         int iStartX = startX;
         chatStrNokiaParagraph = new String[8][1];
         String temp;
         int pos = 0;
         int line = 1;
         for (int i = 0; i < length; i++) {
             tempChar = text.charAt(i);
             if (i < length - 1) {
                 tempChar1 = text.charAt(i + 1);
             }
             if (tempChar == '/') {
                 if (tempChar1 == '1'
                         || tempChar1 == '2'
                         || tempChar1 == '3'
                         || tempChar1 == '4'
                         || tempChar1 == '5'
                         || tempChar1 == '6'
                         || tempChar1 == '7'
                         || tempChar1 == '8'
                         || tempChar1 == '9'
                         || tempChar1 == '0'
                         || tempChar1 == '*'
                         || tempChar1 == '#') {
                     int charTwo = 0;
                     if (tempChar1 == '*') {
                         charTwo = Constant.FONT_SMALL.stringWidth("/*0");
                     } else {
                         charTwo = Constant.FONT_SMALL.stringWidth("/10");
                     }
                     if (tempLength + 15 > lineWidth) {
                         line += 1;
                         pos = i;
                         iStartX = startX;
                         iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
                         tempLength = Constant.FONT_SMALL.charWidth(tempChar);
 //                        Tools.printLog("1111111111111111111111111111");
                     }
                     tempLength = tempLength + 15 - charTwo;
                     iStartX = iStartX + 15 - charTwo;
 
                 } else if (tempChar1 == '%') {
                     //去掉图片显示
                     int charTwo = Constant.FONT_SMALL.stringWidth("/%5");
 //                    int charTwo = charTwo = Constant.FONT_SMALL.stringWidth("/%");
 //                    Tools.printLog("ccccccccccccccccccccccccccccccccccccccccccccccccc");
 //                    if (tempLength + 30 > lineWidth) {//去掉图片显示
 //                        line += 1;
 //                        pos = i;
 //                        iStartX = startX;
 //                        iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
 //                        tempLength = Constant.FONT_SMALL.charWidth(tempChar);
 //                    }
                     //去掉图片显示
                     tempLength = tempLength - charTwo;
                     iStartX = iStartX - charTwo;
 //                    tempLength = tempLength + 30 - charTwo;
 //                    iStartX = iStartX + 30 - charTwo;
                 }
             }
             charWidth = Constant.FONT_SMALL.charWidth(tempChar);
             temp = text.substring(pos, i + 1);
             chatStrNokiaParagraph[line][0] = temp;
 //            Tools.printLog("aaa :::" + chatStrParagraph[line][0]);
             if (tempLength + charWidth <= lineWidth) {
                 tempLength = tempLength + charWidth;
                 iStartX = iStartX + charWidth;
             } else {
                 temp = text.substring(pos, i);
                 chatStrNokiaParagraph[line][0] = temp;
 //                Tools.printLog("bbb :::" + chatStrParagraph[line][0]);
                 line += 1;
                 pos = i;
                 iStartX = startX;
                 iStartX = iStartX + charWidth;
                 tempLength = charWidth;
             }
         }
 //        for (int i = 0; i < chatStrNokiaParagraph.length; i++) {
 //            if (chatStrNokiaParagraph[i][0] != null) {
 //                Tools.printLog("VV :: " + chatStrNokiaParagraph[i][0]);
 //            }
 //        }
     }
    //#endif
    ///////////////////////////////

    public void updateChat() {
//        if (chatindex == 0) {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
            chatSelectindex = chatSelectindex < 6 ? (chatSelectindex + 1) : 0;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
            chatSelectindex = chatSelectindex > 0 ? (chatSelectindex - 1) : 6;
            chatindex = 0;
        }
//        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_1, false)) {
        	chatSelectindex = 0;
        	chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_2, false)) {
            chatSelectindex = 1;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_3, false)) {
            chatSelectindex = 2;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_4, false)) {
            chatSelectindex = 3;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
            chatSelectindex = 4;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_6, false)) {
            chatSelectindex = 5;
            chatindex = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
            chatSelectindex = 6;
            chatindex = 0;
        }
        //////////////////////////////////得到每个频道有多少话
        sendchatindex = -1;
        switch (chatSelectindex) {//
            case 0://综合chatStrArray
                for (int i = 0; i < chatStrArray.length; i++) {
                    if (chatStrArray[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 1://世界chatStrArray_world
                for (int i = 0; i < chatStrArray_world.length; i++) {
                    if (chatStrArray_world[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 2://当前chatStrArray_current
                for (int i = 0; i < chatStrArray_current.length; i++) {
                    if (chatStrArray_current[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 3://私聊chatStrArray_Private
                for (int i = 0; i < chatStrArray_Private.length; i++) {
                    if (chatStrArray_Private[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 4://队伍 chatStrArray_team
                for (int i = 0; i < chatStrArray_team.length; i++) {
                    if (chatStrArray_team[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 5://帮派 chatStrArray_gang
                for (int i = 0; i < chatStrArray_gang.length; i++) {
                    if (chatStrArray_gang[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
            case 6://系统 chatStrArray_system
                for (int i = 0; i < chatStrArray_system.length; i++) {
                    if (chatStrArray_system[i][0] != null) {
                        sendchatindex = i;
                    }
                }
                break;
        }
//        System.out.println("chatindex  ::: " + (chatindex - 1));
//        System.out.println("sendchatindex  ::: " + sendchatindex);
        //////////////////////////////////////
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            chatindex = chatindex < (sendchatindex + 1) ? (chatindex + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            chatindex = chatindex > 0 ? (chatindex - 1) : (sendchatindex + 1);
        }
//        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) {
//            System.out.println("11111111111111111111111111111111111");
//            this.sStrArray = new String[1];
//            taskORitems_ID = new String[4];
//            taskORitems_new = "";
//            taskORitems_id = null;
//            taskORitems_name = null;
//            taskORitems_items = null;
//            taskORitems_col = null;
//            chatshoutType = 2;
//            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
//            MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "区域发送聊天");
//            MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
//            MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
//        }

        if (chatindex == 0) {
            //综合频道
            if ((chatSelectindex == 1
                    || chatSelectindex == 0) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) //                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_2, false)
                    ) {//世界
                this.sStrArray = new String[1];
                taskORitems_ID = new String[4];
                taskORitems_new = "";
                taskORitems_id = null;
                taskORitems_name = null;
                taskORitems_items = null;
                taskORitems_col = null;
                chatshoutType = 1;
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "世界");
                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
            if ((chatSelectindex == 2) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) //                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_3, false)
                    ) {//当前
                this.sStrArray = new String[1];
                taskORitems_ID = new String[4];
                taskORitems_new = "";
                taskORitems_id = null;
                taskORitems_name = null;
                taskORitems_items = null;
                taskORitems_col = null;
                chatshoutType = 2;
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "区域");
                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            } else if ((chatSelectindex == 4) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) //                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)
                    ) {//队伍
                if (MainLogic.getInstance().uiInterFace.team.getTeamMemberNum() <= 0) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有加入队伍!");
                } else {
                    this.sStrArray = new String[1];
                    taskORitems_ID = new String[4];
                    taskORitems_new = "";
                    taskORitems_id = null;
                    taskORitems_name = null;
                    taskORitems_items = null;
                    taskORitems_col = null;
                    chatshoutType = 4;
                    GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                    MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "队伍");
                    MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                    MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
                }
            } else if ((chatSelectindex == 5) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) //                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_6, false)
                    ) {//帮派
                if (MainLogic.getInstance().gamePlayer.sTongName == null) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有加入帮派!");
                } else {
                    this.sStrArray = new String[1];
                    taskORitems_ID = new String[4];
                    taskORitems_new = "";
                    taskORitems_id = null;
                    taskORitems_name = null;
                    taskORitems_items = null;
                    taskORitems_col = null;
                    chatshoutType = 5;
                    GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                    MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "帮派");
                    MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                    MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
                }

            } else if ((chatSelectindex == 3) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) //                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_4, false)
                    ) {//私聊
                Tools.printLog("chatOtherplayerName ::: " + chatOtherplayerName.length());
                Tools.printLog("chatOtherplayerName ::: " + chatOtherplayerName);
                if (MainLogic.getInstance().uiEquipment.chatOtherplayerName.equals(MainLogic.getInstance().gamePlayer.sPlayerName)) {
                    MainLogic.getInstance().uiEquipment.chatOtherplayerName = "";
                }
                this.sStrArray = new String[1];
                taskORitems_ID = new String[4];
                taskORitems_new = "";
                taskORitems_id = null;
                taskORitems_name = null;
                taskORitems_items = null;
                taskORitems_col = null;
                chatshoutType = 3;
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "私聊发送聊天");
                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
//            else if ((chatSelectindex == 6) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
//                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))
//                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
            //跳转到聊天设置
//                MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT_SET, true);
//            }
        } else {//选择对话弹出相应的选择
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                if (sendchatindex >= (chatindex - 1)) {
//                    for (int i = 0; i < 7; i++) {
//                        System.out.println(i + "   " + chatStrArray_current[sendchatindex - (chatindex - 1)][i]);
//                    }
                    if (chatSelectindex == 0) {
                        if (chatStrArray[sendchatindex - (chatindex - 1)][0] == null
                                || chatStrArray[sendchatindex - (chatindex - 1)][0].equals("5")) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        } else {
                            MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT_SECOND, true);
                            chatSecondSelect = 0;
                        }
                    } else if (chatSelectindex == 6) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                    } else {
                        MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT_SECOND, true);
                        chatSecondSelect = 0;
                    }
                }
            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            //跳转到漫游界面
//            Tools.changeRoamUiSate((byte) 9, 3);
            Tools.openRoamMenu(false, (byte) 1, (byte) 9, 3);
        }
    }
    public static int chatSecondSelect;

    public void drawChatSecond(Graphics g) {
        int fillRect_W = Constant.FONT_SMALL.stringWidth(chatStrSelect[1]) + 10;
        int font_H = Constant.FONT_SMALL.getHeight();
        int interval_H = 5;
        int start_Y = 21;
        int selectLength = chatStrSelect.length;
        g.setColor(0x989898);
        g.fillRect((Constant.SCREEN_WIDTH - fillRect_W) / 2, start_Y - 5, fillRect_W, font_H * (selectLength + 1) + interval_H * selectLength + 10);
        Tools.drawShadowString(g, (byte) 1, StrSelect, (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(StrSelect)) / 2,
                start_Y, 0x00E7FF, 0x333333);
        for (int i = 0; i < selectLength; i++) {
            g.setColor(0x808281);
            g.fillRect((Constant.SCREEN_WIDTH - fillRect_W) / 2,
                    start_Y + (font_H + interval_H) + (font_H + interval_H) * i,
                    fillRect_W, font_H);
            Tools.drawShadowString(g, (byte) 1, chatStrSelect[i], (Constant.SCREEN_WIDTH - fillRect_W) / 2 + 5,
                    start_Y + (font_H + interval_H) + (font_H + interval_H) * i,
                    i == chatSecondSelect ? 0x00E7FF : 0xFFFFFF, 0x333333);
        }
        //画选择
        if (this.imgArray[1] != null) {
            Tools.drawTilePic(g, (byte) 1, 0,
                    start_Y + (font_H + interval_H) - this.imgArray[1].getHeight() + (font_H + interval_H) * chatSecondSelect,
                    Constant.SCREEN_WIDTH, this.imgArray[1],
                    0, 0,
                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
            g.setColor(0x000000);
            g.drawLine(0, start_Y + (font_H + interval_H) + (font_H + interval_H) * chatSecondSelect,
                    Constant.SCREEN_WIDTH, start_Y + (font_H + interval_H) + (font_H + interval_H) * chatSecondSelect);
            Tools.drawTilePic(g, (byte) 1, 0,
                    start_Y + (font_H + interval_H) + (font_H + interval_H) * chatSecondSelect + font_H,
                    Constant.SCREEN_WIDTH, this.imgArray[1],
                    0, 0,
                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
        }
        g.setColor(0x000000);
        g.drawLine(0, start_Y + (font_H + interval_H) + (font_H + interval_H) * chatSecondSelect + font_H,
                Constant.SCREEN_WIDTH, start_Y + (font_H + interval_H) + (font_H + interval_H) * chatSecondSelect + font_H);
        //画提示
    }

    public void updateChatSecond() {
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }

        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            chatSecondSelect = chatSecondSelect < chatStrSelect.length - 1 ? (chatSecondSelect + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            chatSecondSelect = chatSecondSelect > 0 ? (chatSecondSelect - 1) : chatStrSelect.length - 1;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_1, false)) {
            chatSecondSelect = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_2, false)) {
            chatSecondSelect = 1;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_3, false)) {
            chatSecondSelect = 2;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_4, false)) {
            chatSecondSelect = 3;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
            chatSecondSelect = 4;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_6, false)) {
            chatSecondSelect = 5;
        }
        if ((chatSecondSelect == 0) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
            //私聊
            boolean issend = false;
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray   " + chatStrArray[chatindex - 1][i]);
//                    }
                    break;
                case 1://世界
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_world   " + chatStrArray_world[chatindex - 1][i]);
//                    }
                    break;
                case 2://当前
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_current   " + chatStrArray_current[chatindex - 1][i]);
//                    }
                    break;
                case 3://私聊
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_Private   " + chatStrArray_Private[chatindex - 1][i]);
//                    }
                    break;
                case 4://队伍
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
                    break;
                case 5://帮派
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
                    break;
                case 6://系统
                    if (MainLogic.getInstance().gamePlayer.sPlayerName.equals(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][2])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][0] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][2].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + " chatStrArray_system  " + chatStrArray_system[chatindex - 1][i]);
//                    }
                    break;
            }
            if (!issend) {
                this.sStrArray = new String[1];
                taskORitems_ID = new String[4];
                taskORitems_new = "";
                taskORitems_id = null;
                taskORitems_name = null;
                taskORitems_items = null;
                taskORitems_col = null;
                chatshoutType = 3;
                if (MainLogic.getInstance().uiEquipment.chatOtherplayerName.equals(MainLogic.getInstance().gamePlayer.sPlayerName)) {
                    MainLogic.getInstance().uiEquipment.chatOtherplayerName = "";
                }
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "私聊发送聊天");
                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
        }
        if ((chatSecondSelect == 1) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
            boolean issend = false;
            long otherplayer_id = -1L;
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray   " + chatStrArray[chatindex - 1][i]);
//                    }
                    break;
                case 1://世界
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_world   " + chatStrArray_world[chatindex - 1][i]);
//                    }
                    break;
                case 2://当前
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4].equals("")) {//系统提示
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_current   " + chatStrArray_current[chatindex - 1][i]);
//                    }
                    break;
                case 3://私聊
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_Private   " + chatStrArray_Private[chatindex - 1][i]);
//                    }
                    break;
                case 4://队伍
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 5://帮派
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 6://系统
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + " chatStrArray_system  " + chatStrArray_system[chatindex - 1][i]);
//                    }
                    break;
            }
            if (!issend) {
//                System.out.println("查看此人");
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
                GameBean.L_PLAYER_ID = otherplayer_id;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OTHER_PLAYER_DETAIL, Constant.SOCKET_MSG_TYPE_LOGIC);
            }
        }
        if ((chatSecondSelect == 2) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (chatStrArray[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
//                            GameBean.BY_CMD_COLUMN_TYPE = 1;
//                            MainLogic.getInstance().uiInterFace.sysMessage.checkStoreItem(chatStrArray[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray[sendchatindex - (chatindex - 1)][6].length() - 1),
//                                    Byte.parseByte(chatStrArray[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
//                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray[sendchatindex - (chatindex - 1)][7].length()))),
//                                    chatStrArray[sendchatindex - (chatindex - 1)][5]);
//                            System.out.println("物品ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkItem(chatStrArray[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray[sendchatindex - (chatindex - 1)][7].length()))),
                                    Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询
//                            System.out.println("宠物ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 1://世界 chatStrArray_world
                    if (chatStrArray_world[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_world[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            MainLogic.getInstance().uiInterFace.sysMessage.checkItem(chatStrArray_world[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_world[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_world[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_world[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_world[sendchatindex - (chatindex - 1)][7].length()))),
                                    Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_world[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询

                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_world[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 2://当前 chatStrArray_current
                    if (chatStrArray_current[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_current[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
                            MainLogic.getInstance().uiInterFace.sysMessage.checkItem(chatStrArray_current[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_current[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_current[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_current[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_current[sendchatindex - (chatindex - 1)][7].length()))),
                                    Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_current[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询

                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_current[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 3://私聊 chatStrArray_Private
                    if (chatStrArray_Private[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_Private[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
                            MainLogic.getInstance().uiInterFace.sysMessage.checkStoreItem(chatStrArray_Private[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_Private[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_Private[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_Private[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_Private[sendchatindex - (chatindex - 1)][7].length()))),
                                    chatStrArray_Private[sendchatindex - (chatindex - 1)][5]);
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询
//                            System.out.println("宠物ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_Private[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 4://队伍 chatStrArray_team
                    if (chatStrArray_team[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_team[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
                            MainLogic.getInstance().uiInterFace.sysMessage.checkStoreItem(chatStrArray_team[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_team[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_team[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_team[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_team[sendchatindex - (chatindex - 1)][7].length()))),
                                    chatStrArray_team[sendchatindex - (chatindex - 1)][5]);
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询
//                            System.out.println("宠物ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_team[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 5://帮派 chatStrArray_gang
                    if (chatStrArray_gang[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_gang[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
                            MainLogic.getInstance().uiInterFace.sysMessage.checkStoreItem(chatStrArray_gang[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_gang[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_gang[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_gang[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_gang[sendchatindex - (chatindex - 1)][7].length()))),
                                    chatStrArray_gang[sendchatindex - (chatindex - 1)][5]);
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询
//                            System.out.println("宠物ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_gang[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
                case 6://系统 chatStrArray_system
                    if (chatStrArray_system[sendchatindex - (chatindex - 1)][5] != null) {
                        if (chatStrArray_system[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("0")) {
                            //跳转到物品查询
                            MainLogic.getInstance().uiInterFace.sysMessage.checkStoreItem(chatStrArray_system[sendchatindex - (chatindex - 1)][6].substring(2, chatStrArray_system[sendchatindex - (chatindex - 1)][6].length() - 1),
                                    Byte.parseByte(chatStrArray_system[sendchatindex - (chatindex - 1)][6].substring(0, 1)),
                                    Goods.getGoodsIconFromID(Integer.parseInt(chatStrArray_system[sendchatindex - (chatindex - 1)][7].substring(1, chatStrArray_system[sendchatindex - (chatindex - 1)][7].length()))),
                                    chatStrArray_system[sendchatindex - (chatindex - 1)][5]);
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][7].substring(0, 1).equals("2")) {
                            //跳转到物品查询
//                            System.out.println("宠物ID   " + Long.parseLong(chatStrArray[sendchatindex - (chatindex - 1)][5]));
                            MainLogic.getInstance().uiInterFace.sysMessage.checkPet(Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]),
                                    Long.parseLong(chatStrArray_system[sendchatindex - (chatindex - 1)][5]));
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            //发送查询物品
                            GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT_SECOND;
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "没有可查询的物品!");
                    }
                    break;
            }
        }
        if ((chatSecondSelect == 3) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
//            System.out.println("好友好友好友好友好友好友好友好友好友好友好友好友");
            boolean issend = false;
            String addname = "";
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][2];
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray   " + chatStrArray[chatindex - 1][i]);
//                    }
                    break;
                case 1://世界
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][2];
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_world   " + chatStrArray_world[chatindex - 1][i]);
//                    }
                    break;
                case 2://当前
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4].equals("")) {//系统提示
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][2];
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_current   " + chatStrArray_current[chatindex - 1][i]);
//                    }
                    break;
                case 3://私聊
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][2];
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_Private   " + chatStrArray_Private[chatindex - 1][i]);
//                    }
                    break;
                case 4://队伍
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][2];
                    }
                    break;
                case 5://帮派
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][2];
                    }
                    break;
                case 6://系统
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        addname = MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][2];
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + " chatStrArray_system  " + chatStrArray_system[chatindex - 1][i]);
//                    }
                    break;
            }
            if (!issend) {
                GameBean.BY_CMD_FRIEND_TYPE = 1;
                GameBean.BY_CMD_FRIEND_MODE = 1;
                GameBean.BY_CMD_FRIEND_NAME = addname;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_ADD_FRIEND, Constant.SOCKET_MSG_TYPE_LOGIC);
                GameBean.b_WAIT_NET_MSG_BACK = true;
                byUiState = 0;
            }
        }
        if ((chatSecondSelect == 4) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
//            System.out.println("组队组队组队组队组队组队组队组队组队组队");
            boolean issend = false;
            long otherplayer_id = -1L;
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray   " + chatStrArray[chatindex - 1][i]);
//                    }
                    break;
                case 1://世界
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_world   " + chatStrArray_world[chatindex - 1][i]);
//                    }
                    break;
                case 2://当前
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4].equals("")) {//系统提示
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_current   " + chatStrArray_current[chatindex - 1][i]);
//                    }
                    break;
                case 3://私聊
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_Private   " + chatStrArray_Private[chatindex - 1][i]);
//                    }
                    break;
                case 4://队伍
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 5://帮派
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 6://系统
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + " chatStrArray_system  " + chatStrArray_system[chatindex - 1][i]);
//                    }
                    break;
            }
            //玩家的的摊位

            if (!issend) {
                if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10101")
                        || MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10201")) {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "战场中无法组队!", (byte) 1, (byte) -1);
                } else if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10301")
                        || MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10401")
                        || MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10501")) {//副本
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "副本中不允许组队!", (byte) 1, (byte) -1);
                } else {
                    if (MainLogic.getInstance().uiInterFace.team.getTeamMemberNum() <= 0) {
                        GameBean.L_PLAYER_ID = otherplayer_id;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_TEAM_JOIN, Constant.SOCKET_MSG_TYPE_LOGIC);
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请求已经发出!", (byte) 1, (byte) -1);
                        byUiState = 0;
                    } else if (MainLogic.getInstance().uiInterFace.team.getTeamMemberNum() < Constant.MAX_TEAM_MEMBER_NUM) {
                        if (MainLogic.getInstance().uiInterFace.team.getMemberPos(GameBean.L_PLAYER_ID) != -1) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "该玩家已在您的队伍中!", (byte) 1, (byte) -1);
                        } else if (!MainLogic.getInstance().uiInterFace.team.isMeLeader()) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "只有队长才能邀请玩家入队!", (byte) 1, (byte) -1);
                        } else {
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_TEAM_JOIN, Constant.SOCKET_MSG_TYPE_LOGIC);
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请求已经发出!", (byte) 1, (byte) -1);
                            byUiState = 0;
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "队伍人数已满!", (byte) 1, (byte) -1);
                    }
                }
            }
        }

        //玩家的的摊位
        if ((chatSecondSelect == 5) && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false))) {
            boolean issend = false;
            long otherplayer_id = -1L;
            switch (chatSelectindex) {//
                case 0://综合chatStrArray
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray   " + chatStrArray[chatindex - 1][i]);
//                    }
                    break;
                case 1://世界
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_world[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_world[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_world   " + chatStrArray_world[chatindex - 1][i]);
//                    }
                    break;
                case 2://当前
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_current[sendchatindex - (chatindex - 1)][4].equals("")) {//系统提示
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_current[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_current   " + chatStrArray_current[chatindex - 1][i]);
//                    }
                    break;
                case 3://私聊
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_Private[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_Private[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + "  chatStrArray_Private   " + chatStrArray_Private[chatindex - 1][i]);
//                    }
                    break;
                case 4://队伍
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_team[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_team[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 5://帮派
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_gang[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_gang[sendchatindex - (chatindex - 1)][4]);
                    }
                    break;
                case 6://系统
                    if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4])) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4] == null) {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else if (chatStrArray_system[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
                        issend = true;
                    } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
                        issend = true;
                    } else {
                        otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray_system[sendchatindex - (chatindex - 1)][4]);
                    }
//                    for (int i = 0; i < 4; i++) {
//                        Tools.printLog(i + " chatStrArray_system  " + chatStrArray_system[chatindex - 1][i]);
//                    }
                    break;
            }
            if (!issend) {
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().uiInterFace.store.openStall(otherplayer_id);
            }
            //////////////////////////
//            long otherplayer_id = -1L;
//            if (MainLogic.getInstance().gamePlayer.lPlayerID == Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4])) {
//                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以对自己操作!");
//            } else if (chatStrArray[sendchatindex - (chatindex - 1)][4] == null) {
//                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
//            } else if (chatStrArray[sendchatindex - (chatindex - 1)][4].equals("")) {//这里是拾到物品时的提示,
//                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
//            } else if (Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]) == 100) {//系统提示,
//                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "不可以操作!");
//            } else {
//                otherplayer_id = Long.parseLong(MainLogic.getInstance().uiEquipment.chatStrArray[sendchatindex - (chatindex - 1)][4]);
//                MainLogic.getInstance().uiInterFace.store.openStall(otherplayer_id);
//            }
        }

        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            //跳转到聊天界面
            MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT, true);
        }
    }

    public void drawSmile(Graphics g) {
        if (imgArray[0] != null) {
            //#if NOKIA_S60V5
             Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                     this.imgArray[6], this.imgArray[4], this.imgArray[5], this.simleArray[0]);
             int font_H = Constant.FONT_SMALL.getHeight();
             int interval_H = 10;
             int start_H = 41;
             int rect_H = font_H * 5 + interval_H * 6;
             //绘制角
             String StrSelect = simleArray[1];
             Tools.drawShadowString(g, (byte) 1, StrSelect, (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(StrSelect)) / 2,
                     start_H + interval_H,
                     0x00E7FF, 0x333333);
             Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                     Constant.SCREEN_WIDTH / 2 - Constant.FONT_SMALL.stringWidth(simleArray[2]) - 15,
                     start_H + interval_H + (Constant.FONT_SMALL.getHeight() - 7) / 2);
             Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                     Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(simleArray[2]) + 10,
                     start_H + interval_H + (Constant.FONT_SMALL.getHeight() - 7) / 2);
             //横条
             Tools.drawTilePic(g, (byte) 1, 0,
                     start_H + interval_H + font_H - this.imgArray[1].getHeight(),
                     Constant.SCREEN_WIDTH, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             g.setColor(0x000000);
             g.drawLine(0, start_H + interval_H + font_H,
                     Constant.SCREEN_WIDTH, start_H + interval_H + font_H);
 //
             int strSmile_W = Constant.FONT_SMALL.stringWidth(strSmile1[0] + strSmile[0]) + 15;
             int strSmile_X = (Constant.SCREEN_WIDTH - strSmile_W * 3) / 4;
             int strSmile_Y = (Constant.NEW_END_LINE - 46 - font_H * 4 - interval_H * 3) / 2;
             //画选择
             Tools.drawTilePic(g, (byte) 1, strSmile_X
                     + (strSmile_W + strSmile_X) * (smileindex % 3),
                     start_H + strSmile_Y
                     + font_H / 2 - this.imgArray[1].getHeight()
                     + (font_H + interval_H) * (smileindex / 3),
                     strSmile_W, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             Tools.drawTilePic(g, (byte) 1, strSmile_X
                     + (strSmile_W + strSmile_X) * (smileindex % 3),
                     start_H + strSmile_Y + font_H / 2
                     + (font_H + interval_H) * (smileindex / 3),
                     strSmile_W, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
             //选择横条
             Tools.drawTilePic(g, (byte) 1, 0,
                     start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3) + font_H - this.imgArray[1].getHeight(),
                     Constant.SCREEN_WIDTH, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             g.setColor(0x000000);
             g.drawLine(0, start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3) + font_H,
                     Constant.SCREEN_WIDTH, start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3) + font_H);
             int smile_H = 0;
             if (font_H > 16) {
                 smile_H = (font_H - 16) / 2;
             }
             for (int i = 0; i < strSmile.length; i++) {
                 Tools.drawShadowString(g, (byte) 1, strSmile1[i], strSmile_X + (strSmile_W + strSmile_X) * (i % 3),
                         start_H + strSmile_Y + (font_H + interval_H) * (i / 3),
                         0xFFFFFF, 0x333333);
                 g.drawRegion(imgArray[8], 15 * i, 0, 15, 16,
                         Constant.TRANS_NONE,
                         strSmile_X + Constant.FONT_SMALL.stringWidth(strSmile1[0])
                         + (strSmile_W + strSmile_X) * (i % 3),
                         start_H + strSmile_Y + smile_H + (font_H + interval_H) * (i / 3),
                         0);
                 Tools.drawShadowString(g, (byte) 1, strSmile[i], strSmile_X + Constant.FONT_SMALL.stringWidth(strSmile1[0]) + 15
                         + (strSmile_W + strSmile_X) * (i % 3),
                         start_H + strSmile_Y + (font_H + interval_H) * (i / 3),
                         0xFFFFFF, 0x333333);
             }
            //#else
//#            Tools.drawFrame(g,
//#                    Constant.UI_START_X,
//#                    Constant.UI_START_Y,
//#                    this.imgArray[2],
//#                    this.imgArray[0],
//#                    this.imgArray[1],
//#                    this.imgArray[6],
//#                    0, 0, 24, 12,
//#                    this.imgArray[6],
//#                    48, 0, 24, 12,
//#                    simleArray[0], 0xFFFFFF);
//#            int font_H = Constant.FONT_SMALL.getHeight();
//#            int interval_H = 10;
//#            int start_H = 21;
//#            int rect_H = font_H * 5 + interval_H * 6;
//#            //绘制角
//#            String StrSelect = simleArray[1];
//#            Tools.drawShadowString(g, (byte) 1, StrSelect, (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(StrSelect)) / 2,
//#                    start_H + interval_H,
//#                    0x00E7FF, 0x333333);
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                    Constant.SCREEN_WIDTH / 2 - Constant.FONT_SMALL.stringWidth(simleArray[2]) - 15,
//#                    start_H + interval_H + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                    Constant.SCREEN_WIDTH / 2 + Constant.FONT_SMALL.stringWidth(simleArray[2]) + 10,
//#                    start_H + interval_H + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#
//#            //横条
//#            Tools.drawTilePic(g, (byte) 1, 0,
//#                    start_H + interval_H,
//#                    Constant.SCREEN_WIDTH, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            g.setColor(0x000000);
//#            g.drawLine(0, start_H + interval_H + this.imgArray[1].getHeight(),
//#                    Constant.SCREEN_WIDTH, start_H + interval_H + this.imgArray[1].getHeight());
//#//
//#            int strSmile_W = Constant.FONT_SMALL.stringWidth(strSmile1[0] + strSmile[0]) + 15;
//#            int strSmile_X = (Constant.SCREEN_WIDTH - strSmile_W * 3) / 4;
//#            int strSmile_Y = (Constant.SCREEN_HEIGHT - 46 - font_H * 4 - interval_H * 3) / 2;
//#            //画选择
//#            Tools.drawTilePic(g, (byte) 1, strSmile_X
//#                    + (strSmile_W + strSmile_X) * (smileindex % 3),
//#                    start_H + strSmile_Y
//#                    + font_H / 2 - this.imgArray[1].getHeight()
//#                    + (font_H + interval_H) * (smileindex / 3),
//#                    strSmile_W, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            Tools.drawTilePic(g, (byte) 1, strSmile_X
//#                    + (strSmile_W + strSmile_X) * (smileindex % 3),
//#                    start_H + strSmile_Y + font_H / 2
//#                    + (font_H + interval_H) * (smileindex / 3),
//#                    strSmile_W, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
//#            //选择横条
//#            Tools.drawTilePic(g, (byte) 1, 0,
//#                    start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3),
//#                    Constant.SCREEN_WIDTH, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            g.setColor(0x000000);
//#            g.drawLine(0, start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3) + this.imgArray[1].getHeight(),
//#                    Constant.SCREEN_WIDTH, start_H + strSmile_Y + (font_H + interval_H) * (smileindex / 3) + this.imgArray[1].getHeight());
//#            for (int i = 0; i < strSmile.length; i++) {
//#                Tools.drawShadowString(g, (byte) 1, strSmile1[i], strSmile_X + (strSmile_W + strSmile_X) * (i % 3),
//#                        start_H + strSmile_Y + (font_H + interval_H) * (i / 3),
//#                        0xFFFFFF, 0x333333);
//#                g.drawRegion(imgArray[5], 15 * i, 0, 15, 16,
//#                        Constant.TRANS_NONE,
//#                        strSmile_X + Constant.FONT_SMALL.stringWidth(strSmile1[0])
//#                        + (strSmile_W + strSmile_X) * (i % 3),
//#                        start_H + strSmile_Y + (font_H + interval_H) * (i / 3),
//#                        0);
//#                Tools.drawShadowString(g, (byte) 1, strSmile[i], strSmile_X + Constant.FONT_SMALL.stringWidth(strSmile1[0]) + 15
//#                        + (strSmile_W + strSmile_X) * (i % 3),
//#                        start_H + strSmile_Y + (font_H + interval_H) * (i / 3),
//#                        0xFFFFFF, 0x333333);
//#            }
            //#endif
        }
    }
    public static int smileindex;

    public void updateSmile() {
        try {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                smileindex = smileindex < 11 ? (smileindex + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                smileindex = smileindex > 0 ? (smileindex - 1) : 11;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                smileindex = smileindex < 9 ? (smileindex + 3) : (smileindex - 9);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                smileindex = smileindex > 2 ? (smileindex - 3) : (smileindex + 9);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_1, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/1" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_2, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/2" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_3, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/3" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_4, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/4" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_5, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/5" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_6, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/6" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_7, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/7" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_8, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/8" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_9, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/9" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_0, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/0" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_STAR, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/*" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POUND, false)) {
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + "/#" + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                String[] str = {//
                    "/1", "/2", "/3",//
                    "/4", "/5", "/6",//
                    "/7", "/8", "/9",//
                    "/*", "/0", "/#",//
                };
                MainLogic.getInstance().inputInterFace.commonInput.setString(
                        MainLogic.getInstance().inputInterFace.commonInput.getString() + str[smileindex] + "0");
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace.inputInterSmile);
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_CHAT;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static int[] chatSet = {0, 0, 0, 0, 0, 0, 0};//频道设置的开关0开，1关//需要保存
    public int chatSetindex;

    public void drawChatSet(Graphics g) {
        //#if NOKIA_S40V3 || MOT0 || K790
        //#elif NORMAL_240_400
//#         g.setColor(0x000000);
//#         g.fillRect(Constant.UI_START_X, 0, Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT);
        //#else
        g.drawImage(this.imgArray[2], Constant.UI_START_X, Constant.UI_START_Y, 0);
        //#endif

        g.setColor(0x333333);
        g.fillRect(Constant.UI_START_X, 0, Constant.SCREEN_WIDTH, 21);
        Tools.drawShadowString(g, (byte) 1, chatSetArray[0], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                - Constant.FONT_SMALL.stringWidth(chatSetArray[0])) >> 1), Constant.UI_START_Y, 0xFFFFFF, 0x333333);
        int interval_H = 4;
        int font_H = Constant.FONT_SMALL.getHeight();
        int start_W = 20 + Constant.FONT_SMALL.stringWidth(chatSetArray[1]);
        int rect_H = font_H * 7 + interval_H * 8;
        int start_H = (Constant.SCREEN_HEIGHT - rect_H) / 2;

        //绘制角
        g.drawRegion(imgArray[3], 0, 0, 7, 7, Constant.TRANS_NONE, start_W - 7, start_H - 7, 0); //左上角
        g.drawRegion(imgArray[3], 8, 0, 7, 7, Constant.TRANS_NONE,
                Constant.SCREEN_WIDTH - start_W + 7, start_H - 7, g.RIGHT | g.TOP);//右上角
        g.drawRegion(imgArray[3], 0, 8, 7, 7, Constant.TRANS_NONE,
                start_W - 7, start_H + rect_H + 7, g.LEFT | g.BOTTOM); //左下角
        g.drawRegion(imgArray[3], 8, 8, 7, 7, Constant.TRANS_NONE,
                Constant.SCREEN_WIDTH - start_W + 7, start_H + rect_H + 7, g.RIGHT | g.BOTTOM);//右下角
        //绘制四条
        g.setColor(0x989898);
        g.fillRect(start_W, start_H - 7, Constant.SCREEN_WIDTH - start_W * 2, 7);//上条
        g.fillRect(start_W, start_H + rect_H, Constant.SCREEN_WIDTH - start_W * 2, 7);//下条
        g.fillRect(start_W - 7, start_H, 7, rect_H);//左条
        g.fillRect(Constant.SCREEN_WIDTH - start_W, start_H, 7, rect_H);//右条
        g.fillRect(start_W, start_H, Constant.SCREEN_WIDTH - start_W * 2, rect_H);//背景
        //三条框
        for (int i = 0; i < 3; i++) {
            g.setColor(0x777777);
            g.fillRect(start_W - 7, start_H + interval_H * 2 + font_H - 2 + (font_H * 2 + interval_H * 2) * i,
                    Constant.SCREEN_WIDTH - start_W * 2 + 14, font_H + 4);//
        }
        int[] strcol = {0xc000ff, 0xc0781a, 0xffffff, 0xb0378f, 0x12b443, 0x0e3eba, 0xff0000};
        for (int i = 0; i < strSet.length; i++) {
            Tools.drawShadowString(g, (byte) 1, strSet[i],
                    start_W + 5, start_H + interval_H + (font_H + interval_H) * i,
                    strcol[i], 0x000000);
            Tools.drawShadowString(g, (byte) 1, chatSet[i] == 0 ? chatSetArray[2] : chatSetArray[3],
                    Constant.SCREEN_WIDTH - start_W - 5 - Constant.FONT_SMALL.stringWidth(chatSetArray[2]),
                    start_H + interval_H + (font_H + interval_H) * i,
                    chatSet[i] == 0 ? 0x00E7FF : 0xffffff, 0x000000);
        }
        //画选择
        Tools.drawTilePic(g, (byte) 1, 0,
                start_H + interval_H - 2 + (font_H + interval_H) * chatSetindex - this.imgArray[1].getHeight(),
                Constant.SCREEN_WIDTH, this.imgArray[1],
                0, 0,
                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
        g.setColor(0x000000);
        g.drawLine(0, start_H + interval_H - 2 + (font_H + interval_H) * chatSetindex,
                Constant.SCREEN_WIDTH, start_H + interval_H - 2 + (font_H + interval_H) * chatSetindex);
        Tools.drawTilePic(g, (byte) 1, 0,
                start_H + interval_H + 2 + font_H + (font_H + interval_H) * chatSetindex,
                Constant.SCREEN_WIDTH, this.imgArray[1],
                0, 0,
                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
        g.setColor(0x000000);
        g.drawLine(0, start_H + interval_H + 2 + font_H + (font_H + interval_H) * chatSetindex,
                Constant.SCREEN_WIDTH, start_H + interval_H + 2 + font_H + (font_H + interval_H) * chatSetindex);
        //确定返回
        Tools.drawShadowString(g, (byte) 1, chatSetArray[1], Constant.UI_START_X + 5,
                start_H + interval_H + (font_H + interval_H) * chatSetindex, 0x000000, 0x00E7FF);
        Tools.drawShadowString(g, (byte) 1, chatSetArray[4], Constant.UI_START_X + (Constant.SCREEN_WIDTH
                - Constant.FONT_SMALL.stringWidth(chatSetArray[4])) - 5,
                start_H + interval_H + (font_H + interval_H) * chatSetindex, 0x000000, 0x00E7FF);
        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                Constant.UI_START_X + 8 + Constant.FONT_SMALL.stringWidth(chatSetArray[1]),
                start_H + interval_H + (font_H + interval_H) * chatSetindex + 7);
        Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                Constant.UI_START_X + (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(chatSetArray[4])) - 13,
                start_H + interval_H + (font_H + interval_H) * chatSetindex + 7);
        //结束
        g.setColor(0x333333);
        g.fillRect(Constant.UI_START_X, Constant.SCREEN_HEIGHT - 25, Constant.SCREEN_WIDTH, 21);
        g.setColor(0x000000);
        g.drawRect(Constant.UI_START_X - 1, Constant.SCREEN_HEIGHT - 25, Constant.SCREEN_WIDTH + 2, 21);
        Tools.drawMarquee(g, sMarqueeString, Constant.UI_START_X, iPositionX,
                Constant.SCREEN_HEIGHT - 25 + ((21 - Constant.FONT_SMALL_HEIGHT) >> 1),
                Constant.SCREEN_WIDTH, 0x999999, 0x000000);
    }

    public void updateChatSet() {
        if (sMarqueeString != null) {
            if (iPositionX < 0 && Math.abs(iPositionX) > Constant.FONT_SMALL.stringWidth(sMarqueeString)) {
                iPositionX = Constant.UI_START_X + Constant.SCREEN_WIDTH - 10;
            } else {
                iPositionX = iPositionX - 2;
            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            chatSetindex = chatSetindex < 6 ? (chatSetindex + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            chatSetindex = chatSetindex > 0 ? (chatSetindex - 1) : 6;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
            chatSet[chatSetindex] = chatSet[chatSetindex] < 1 ? (chatSet[chatSetindex] + 1) : 0;
//            Tools.printLog("chatSet[chatSetindex] ::: "+chatSet[chatSetindex]);
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            //跳转到聊天界面
            MainLogic.getInstance().pushState(Constant.GAME_UI_CHAT, true);
        }
    }

    /**
     * 聊天结束
     */
    /**
     * 邮件系统开始
     */
    /**
     * 绘制发送邮件
     */
    public void drawSendEmail(Graphics g) {
        if (this.imgArray[9] != null) {
            //#if NOKIA_S60V5
             if (!addgoods) {
                 Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                         this.imgArray[6], this.imgArray[4], this.imgArray[5], emailArray[0]);
             } else {
                 Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7], this.imgArray[6], this.imgArray[4], this.imgArray[5],
                         97, 0, 51, 24, this.imgArray[5], 50,
                         155, 96, 27, emailArray[0]);
             }
             int start_X = 10;
             int start_Y = 41;
             int wordSpacing_H = 2;
 
 
             if (!addgoods) {
                 if (sendEmail_index == 0) {
                     Tools.drawShadowString(g, (byte) 1, emailArray[1], start_X,
                             start_Y + wordSpacing_H, sendORlist_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
                     if (Constant.CMD_MAIL_TYPE == 0) {
                         Tools.drawShadowString(g, (byte) 1, emailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]),
                                 start_Y + wordSpacing_H, sendORlist_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
                     }
                     if (sendORlist_index == 0) {
                         Tools.drawArrow(g, this.imgArray[0], (byte) 1, start_X - 8, start_Y + wordSpacing_H + 10);
                         Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                                 start_X + Constant.FONT_SMALL.stringWidth(emailArray[1]) + 3,
                                 start_Y + wordSpacing_H + 10);
                     } else {
                         Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                                 Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]) - 8,
                                 start_Y + wordSpacing_H + 18);
                         Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                                 Constant.SCREEN_WIDTH - start_X + 3,
                                 start_Y + wordSpacing_H + 18);
                     }
                 } else {
                     Tools.drawShadowString(g, (byte) 1, emailArray[1], start_X,
                             start_Y + wordSpacing_H, 0xffffff, 0x000000);
                     if (Constant.CMD_MAIL_TYPE == 0) {
                         Tools.drawShadowString(g, (byte) 1, emailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]),
                                 start_Y + wordSpacing_H, 0xffffff, 0x000000);
                     }
                 }
                 Tools.drawShadowString(g, (byte) 1, emailArray[3], start_X,
                         start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), sendEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, shortenStr(Constant.CMD_MAIL_TYPE == 0 ? sendEmail_name : "GM", Constant.SCREEN_WIDTH - start_X * 2 - Constant.FONT_SMALL.stringWidth("[收件人]")),
                         Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(emailArray[3]),
                         start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, emailArray[4], start_X,
                         start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, sendEmail_index == 2 ? 0x00E7FF : 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, shortenStr(sendEmail_title, Constant.SCREEN_WIDTH - start_X * 2 - Constant.FONT_SMALL.stringWidth("[标题]")),
                         Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(emailArray[4]),
                         start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, emailArray[5], start_X,
                         start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 3, sendEmail_index == 3 ? 0x00E7FF : 0xffffff, 0x000000);
                 //绘制金钱
                 if (Constant.CMD_MAIL_TYPE == 0) {
                     Tools.drawShadowString(g, (byte) 1, emailArray[6], start_X,
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                             - 30, sendEmail_index == 4 ? 0x00E7FF : 0xffffff, 0x000000);
 
                     g.drawRegion(this.imgArray[8], 0, 0, 12, 12, Constant.TRANS_NONE,
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]),
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                             + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
                     Tools.drawShadowString(g, (byte) 1, money_gold + emailArray[8], start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 12,
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
                     g.drawRegion(this.imgArray[8], 12, 0, 12, 12, Constant.TRANS_NONE,
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 12
                             + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]),
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                             + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
                     Tools.drawShadowString(g, (byte) 1, money_silver + emailArray[9],
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 24
                             + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]),
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
                     g.drawRegion(this.imgArray[8], 24, 0, 12, 12, Constant.TRANS_NONE,
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 24
                             + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + emailArray[9]),
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                             + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
                     Tools.drawShadowString(g, (byte) 1, money_copper + emailArray[10],
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 36
                             + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + emailArray[9]),
                             Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
                 }
                 //
                 if (Constant.CMD_MAIL_TYPE == 0) {
                     Tools.drawShadowString(g, (byte) 1, emailArray[7], start_X,
                             Constant.NEW_END_LINE - 25 - 6 - 30,
                             sendEmail_index < 5 ? 0xffffff : 0x00E7FF, 0x000000);
                     if (sendEmail_index < 5) {
                         for (int i = 0; i < 4; i++) {
                             emailItems.drawGoods(g, start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[7]) + ((this.imgArray[9].getWidth() + 7) * 2 + 1) * i,
                                     Constant.NEW_END_LINE - 25 - 6
                                     - 30,
                                     (short) i);
                         }
                     } else {
                         for (int i = 0; i < 4; i++) {
                             emailItems.drawGoods(g,
                                     start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[7]) + ((this.imgArray[9].getWidth() + 7) * 2 + 1) * i,
                                     Constant.NEW_END_LINE - 25 - 6
                                     - 30,
                                     (short) (i + (sendEmail_index - 5) * 4));
                         }
                     }
                     Tools.drawArrow(g, this.imgArray[0], (byte) 7, Constant.SCREEN_WIDTH - 7 - 5,
                             Constant.NEW_END_LINE - 25 - 6 - 30);
                     Tools.drawArrow(g, this.imgArray[0], (byte) 8, Constant.SCREEN_WIDTH - 7 - 5,
                             Constant.NEW_END_LINE - 25 - 6 + 7 - 30);
                 }
                 //绘制文本正文背景start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 3
                 int rect_h = Constant.NEW_END_LINE - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
                         - (25 + Constant.FONT_SMALL.getHeight() + 10) - 30;
                 g.setColor(0x000000);
                 g.drawRect(5, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4, Constant.SCREEN_WIDTH - 10, rect_h);
                 //绘制邮件内容
                 Tools.drawHCycleRollingParagraph(g, sendEmail_text,
                         sendEmailTextHeight, Constant.SCREEN_WIDTH - 14,
                         rect_h, Constant.FONT_SMALL.getHeight(),
                         7, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4,
                         0xffffff, 0x000000);
             } else {
 
                 //绘制添加的附件
                 int interval_w = (Constant.SCREEN_WIDTH - (this.imgArray[9].getWidth() + 7) * 10 - 12) / 2;
                 int interval_y = (Constant.NEW_END_LINE - (this.imgArray[9].getWidth() + 7) * 2 - 2) / 2;
                 Tools.drawShadowString(g, (byte) 1, emailArray[7], 12, interval_y - Constant.FONT_SMALL.getHeight() - 5, 0x00E7FF, 0x000000);
 
                 for (int i = 0; i < 10; i++) {
                     items.drawGoods(g,
                             interval_w + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (i % 5),
                             interval_y + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (i / 5), (short) i);
                 }
 //                Tools.drawShadowString(g, (byte) 1, emailArray[12], 12,
 //                        interval_y + (this.imgArray[9].getWidth() + 7) * 4 + 2 + 5, 0x00E7FF, 0x000000);
 //                Tools.drawShadowString(g, (byte) 1, emailArray[11], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(emailArray[11]),
 //                        interval_y + (this.imgArray[9].getWidth() + 7) * 4 + 2 + 5, 0x00E7FF, 0x000000);
                 //格子遮罩
                 Goods.drawGoodsSelectStytle(g, this.imgArray[12],
                         interval_w + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index % 5),
                         interval_y + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index / 5));
 //                Tools.drawTilePic(g, (byte) 1, interval_w + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index % 5) + 7,
 //                        interval_y + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index / 5) + 7,
 //                        28, this.imgArray[1],
 //                        0, this.imgArray[1].getHeight() - 15,
 //                        this.imgArray[1].getWidth(), 15, Constant.TRANS_ROT180);
 //                Tools.drawTilePic(g, (byte) 1, interval_w + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index % 5) + 7,
 //                        interval_y + 15 + ((this.imgArray[9].getWidth() + 7) * 2 + 2) * (addgoods_index / 5) + 7,
 //                        28, this.imgArray[1],
 //                        0, this.imgArray[1].getHeight() - 15,
 //                        this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
                 int rect_h = 20 + Constant.FONT_SMALL.getHeight() * 2 + (this.imgArray[9].getWidth() + 7) * 4 + 2;
                 g.setColor(0x000000);
                 g.drawRect(5, interval_y - Constant.FONT_SMALL.getHeight() - 5 - 5, Constant.SCREEN_WIDTH - 10, rect_h);
             }
             //绘制选择
             int[] choose_y = {
                 start_Y + wordSpacing_H + Constant.FONT_SMALL.getHeight(),//
                 start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2,//
                 start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 3,//
                 start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 4,//
                 Constant.NEW_END_LINE - 25 - 8 - 30,//
                 Constant.NEW_END_LINE - 25 - 6 + 14,//
             };
             if (sendEmail_index < 5) {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         choose_y[sendEmail_index] - this.imgArray[1].getHeight(),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, choose_y[sendEmail_index],
                         Constant.SCREEN_WIDTH, choose_y[sendEmail_index]);
             } else {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         choose_y[5] - this.imgArray[1].getHeight(),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, choose_y[5],
                         Constant.SCREEN_WIDTH, choose_y[5]);
             }
            //#else
//#            if (!addgoods) {
//#                Tools.drawFrame(g, this.imgArray[2], this.imgArray[1], "确定", "返回", emailArray[0]);
//#            } else {
//#                Tools.drawFrame(g, this.imgArray[2], this.imgArray[1], "取消附件", "返回", emailArray[0]);
//#            }
//#//            Tools.drawFrame(g,
//#//                    Constant.UI_START_X, Constant.UI_START_Y,
//#//                    this.imgArray[2],
//#//                    this.imgArray[0],
//#//                    this.imgArray[1],
//#//                    this.imgArray[9],
//#//                    0, 0, 24, 12,
//#//                    this.imgArray[9], 49, 0, 23, 12,
//#//                    emailArray[0], 0xFFFFFF);
//#            int start_X = 10;
//#            int start_Y = 21;
//#            int wordSpacing_H = 2;
//#
//#            if (!addgoods) {
//#                if (sendEmail_index == 0) {
//#                    Tools.drawShadowString(g, (byte) 1, emailArray[1], start_X,
//#                            start_Y + wordSpacing_H, sendORlist_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
//#                    if (Constant.CMD_MAIL_TYPE == 0) {
//#                        Tools.drawShadowString(g, (byte) 1, emailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]),
//#                                start_Y + wordSpacing_H, sendORlist_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#                    }
//#                    if (sendORlist_index == 0) {
//#                        Tools.drawArrow(g, this.imgArray[0], (byte) 1, start_X - 8, start_Y + wordSpacing_H + 7);
//#                        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                                start_X + Constant.FONT_SMALL.stringWidth(emailArray[1]) + 3,
//#                                start_Y + wordSpacing_H + 7);
//#                    } else {
//#                        Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                                Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]) - 8,
//#                                start_Y + wordSpacing_H + 7);
//#                        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                                Constant.SCREEN_WIDTH - start_X + 3,
//#                                start_Y + wordSpacing_H + 7);
//#                    }
//#                } else {
//#                    Tools.drawShadowString(g, (byte) 1, emailArray[1], start_X,
//#                            start_Y + wordSpacing_H, 0xffffff, 0x000000);
//#                    if (Constant.CMD_MAIL_TYPE == 0) {
//#                        Tools.drawShadowString(g, (byte) 1, emailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(emailArray[2]),
//#                                start_Y + wordSpacing_H, 0xffffff, 0x000000);
//#                    }
//#                }
//#                Tools.drawShadowString(g, (byte) 1, emailArray[3], start_X,
//#                        start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), sendEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, shortenStr(Constant.CMD_MAIL_TYPE == 0 ? sendEmail_name : "GM", Constant.SCREEN_WIDTH - start_X * 2 - Constant.FONT_SMALL.stringWidth("[收件人]")),
//#                        Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(emailArray[3]),
//#                        start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, emailArray[4], start_X,
//#                        start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, sendEmail_index == 2 ? 0x00E7FF : 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, shortenStr(sendEmail_title, Constant.SCREEN_WIDTH - start_X * 2 - Constant.FONT_SMALL.stringWidth("[标题]")),
//#                        Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(emailArray[4]),
//#                        start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, emailArray[5], start_X,
//#                        start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 3, sendEmail_index == 3 ? 0x00E7FF : 0xffffff, 0x000000);
//#                if (Constant.CMD_MAIL_TYPE == 0) {
//#                    Tools.drawShadowString(g, (byte) 1, emailArray[6], start_X,
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                            - 30, sendEmail_index == 4 ? 0x00E7FF : 0xffffff, 0x000000);
//#                    //绘制金钱
//#                    g.drawRegion(this.imgArray[5], 0, 0, 12, 12, Constant.TRANS_NONE,
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]),
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                            + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#                    Tools.drawShadowString(g, (byte) 1, money_gold + emailArray[8], start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 12,
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#                    g.drawRegion(this.imgArray[5], 12, 0, 12, 12, Constant.TRANS_NONE,
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 12
//#                            + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]),
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                            + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#                    Tools.drawShadowString(g, (byte) 1, money_silver + emailArray[9],
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 24
//#                            + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]),
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#                    g.drawRegion(this.imgArray[5], 24, 0, 12, 12, Constant.TRANS_NONE,
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 24
//#                            + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + emailArray[9]),
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                            + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#                    Tools.drawShadowString(g, (byte) 1, money_copper + emailArray[10],
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[6]) + 36
//#                            + Constant.FONT_SMALL.stringWidth(money_gold + emailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + emailArray[9]),
//#                            Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#                }
//#                //
//#                if (Constant.CMD_MAIL_TYPE == 0) {
//#                    Tools.drawShadowString(g, (byte) 1, emailArray[7], start_X,
//#                            Constant.SCREEN_HEIGHT - 25 - 6 - 30,
//#                            sendEmail_index < 5 ? 0xffffff : 0x00E7FF, 0x000000);
//#                    if (sendEmail_index < 5) {
//#                        for (int i = 0; i < 4; i++) {
//#                            emailItems.drawGoods(g, start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[7]) + (this.imgArray[6].getWidth() * 2 + 1) * i,
//#                                    Constant.SCREEN_HEIGHT - 25 - 6
//#                                    - 30,
//#                                    (short) i);
//#                        }
//#                    } else {
//#                        for (int i = 0; i < 4; i++) {
//#                            emailItems.drawGoods(g,
//#                                    start_X + 2 + Constant.FONT_SMALL.stringWidth(emailArray[7]) + (this.imgArray[6].getWidth() * 2 + 1) * i,
//#                                    Constant.SCREEN_HEIGHT - 25 - 6
//#                                    - 30,
//#                                    (short) (i + (sendEmail_index - 5) * 4));
//#                        }
//#                    }
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 7, Constant.SCREEN_WIDTH - 7 - 5,
//#                            Constant.SCREEN_HEIGHT - 25 - 6 - 30);
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 8, Constant.SCREEN_WIDTH - 7 - 5,
//#                            Constant.SCREEN_HEIGHT - 25 - 6 + 7 - 30);
//#                }
//#                //绘制文本正文背景
//#//                int rect_h = Constant.SCREEN_HEIGHT - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
//#//                        - (25 + Constant.FONT_SMALL.getHeight() * 3 + 10) - (30 - Constant.FONT_SMALL.getHeight());
//#                int rect_h = Constant.SCREEN_HEIGHT - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
//#                        - (25 + Constant.FONT_SMALL.getHeight() + 10) - 30;
//#                g.setColor(0x000000);
//#                g.drawRect(5, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4, Constant.SCREEN_WIDTH - 10, rect_h);
//#                //绘制邮件内容
//#                Tools.drawHCycleRollingParagraph(g, sendEmail_text,
//#                        sendEmailTextHeight, Constant.SCREEN_WIDTH - 14,
//#                        rect_h, Constant.FONT_SMALL.getHeight(),
//#                        7, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4,
//#                        0xffffff, 0x000000);
//#            } else {
//#                //绘制添加的附件
//#                int interval_w = (Constant.SCREEN_WIDTH - this.imgArray[6].getWidth() * 10 - 12) / 2;
//#                int interval_y = (Constant.SCREEN_HEIGHT - this.imgArray[6].getWidth() * 2 - 2) / 2;
//#                Tools.drawShadowString(g, (byte) 1, emailArray[7], 12, interval_y - Constant.FONT_SMALL.getHeight() - 5, 0x00E7FF, 0x000000);
//#
//#                for (int i = 0; i < 10; i++) {
//#                    items.drawGoods(g,
//#                            interval_w + (this.imgArray[6].getWidth() * 2 + 2) * (i % 5),
//#                            interval_y + (this.imgArray[6].getWidth() * 2 + 2) * (i / 5), (short) i);
//#                }
//#//                Tools.drawShadowString(g, (byte) 1, emailArray[11], 12,
//#//                        interval_y + this.imgArray[6].getWidth() * 4 + 2 + 5, 0x00E7FF, 0x000000);
//#//                Tools.drawShadowString(g, (byte) 1, emailArray[12], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(emailArray[12]),
//#//                        interval_y + this.imgArray[6].getWidth() * 4 + 2 + 5, 0x00E7FF, 0x000000);
//#                //格子遮罩
//#                Goods.drawGoodsSelectStytle(g, this.imgArray[11],
//#                        interval_w + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index % 5),
//#                        interval_y + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index / 5));
//#//                Tools.drawTilePic(g, (byte) 1, interval_w + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index % 5),
//#//                        interval_y + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index / 5),
//#//                        30, this.imgArray[1],
//#//                        0, this.imgArray[1].getHeight() - 15,
//#//                        this.imgArray[1].getWidth(), 15, Constant.TRANS_ROT180);
//#//                Tools.drawTilePic(g, (byte) 1, interval_w + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index % 5),
//#//                        interval_y + 15 + (this.imgArray[6].getWidth() * 2 + 2) * (addgoods_index / 5),
//#//                        30, this.imgArray[1],
//#//                        0, this.imgArray[1].getHeight() - 15,
//#//                        this.imgArray[1].getWidth(), 15, Constant.TRANS_NONE);
//#                int rect_h = 20 + Constant.FONT_SMALL.getHeight() * 2 + this.imgArray[6].getWidth() * 4 + 2;
//#                g.setColor(0x000000);
//#                g.drawRect(5, interval_y - Constant.FONT_SMALL.getHeight() - 5 - 5, Constant.SCREEN_WIDTH - 10, rect_h);
//#            }
//#            //绘制选择
//#            int[] choose_y = {
//#                start_Y + wordSpacing_H + Constant.FONT_SMALL.getHeight(),//
//#                start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2,//
//#                start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 3,//
//#                start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 4,//
//#                Constant.SCREEN_HEIGHT - 25 - 8
//#                - 30,//
//#                Constant.SCREEN_HEIGHT - 25 - 6,//
//#            };
//#            if (sendEmail_index < 5) {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        choose_y[sendEmail_index] - this.imgArray[1].getHeight(),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, choose_y[sendEmail_index],
//#                        Constant.SCREEN_WIDTH, choose_y[sendEmail_index]);
//#            } else {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        choose_y[5] - this.imgArray[1].getHeight(),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, choose_y[5],
//#                        Constant.SCREEN_WIDTH, choose_y[5]);
//#            }
            //#endif
        }
        
        //Yujiang
        if(!addgoods)
        	MainView.drawTouchRect(g, mSendEmailTouchRect);
        else
        	MainView.drawTouchRect(g, mSendEmailGoodsTouchRect);
        
    }

    public void clearEmail() {
        this.imgArray = null;
        this.emailArray = null;
        this.str_sendEmailText = null;
        this.viewEmailArray = null;
        this.str5 = null;
    }
    public static String[] str_sendEmailText = new String[1];
    private static int sendText_CurrentPage, sendText_TotalPage;
    public static int sendEmailTextHeight;
    //一段文字分页

    public void getParagraphPage(String text, int rowWidth, int rowHeight, int textHeight) {
        if (text == null) {
            return;
        }
        str_sendEmailText = new String[10];
        if (rowHeight < Constant.FONT_SMALL_HEIGHT) {
            rowHeight = Constant.FONT_SMALL_HEIGHT;
        }
        int length = text.length();
        char tempChar;
        int tempLength = 0;
        int iStartX = 0;
        int iStartY = Constant.FONT_SMALL_HEIGHT;
        int height = 0;
        int page = 0;
        int Charposition = 0;
        for (int i = 0; i < length; i++) {
            tempChar = text.charAt(i);
            if (tempChar == '<') {
                if (i == length - 1) {
                    break;
                }
                tempChar = text.charAt(i + 1);
                i += 1;
            } else if (tempChar == '>') {
//                color = fontColor;
//                g.setColor(fontColor);
            } else if (tempChar == '#') {
                tempLength = 0;
                iStartX = 0;
                iStartY = iStartY + rowHeight;
                if (iStartY > textHeight) {
                    str_sendEmailText[page] = text.substring(Charposition, i);
                    Charposition = i;
                    page++;
                    iStartY = Constant.FONT_SMALL_HEIGHT;
                }
            } else {
                if (tempLength + Constant.FONT_SMALL.charWidth(tempChar) > rowWidth) {
                    iStartY = iStartY + rowHeight;
                    iStartX = 0;
                    tempLength = 0;
                    if (iStartY > textHeight) {
                        str_sendEmailText[page] = text.substring(Charposition, i);
                        Charposition = i;
                        page++;
                        iStartY = Constant.FONT_SMALL_HEIGHT;
                    }
                }
                tempLength = tempLength + Constant.FONT_SMALL.charWidth(tempChar);
                iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
                str_sendEmailText[page] = text.substring(Charposition, i + 1);
            }
        }
        sendText_TotalPage = page;
//        for (int i = 0; i < str_sendEmailText.length; i++) {
//            Tools.printLog(i + "  i ::   " + str_sendEmailText[i]);
//        }
    }
    public static int sendEmail_index, sendORlist_index;
    public static long money_gold, money_silver, money_copper;//金钱，金，银，铜
    public long havemoney_gold = 0, havemoney_silver = 0, havemoney_copper = 0;//这里自己写的玩家金钱数，测试用
    public static String[] sStrArray_gold = new String[1], sStrArray_silver = new String[1], sStrArray_copper = new String[1];
    private static boolean addgoods;
    public static int addgoods_index;
    public static int SendEmail_State;
    public static String sendEmail_name, sendEmail_title, sendEmail_text;
    public static short[][] isSelected;//邮件附件的位置，附件的类型，附件在背包中的位置
    public static int checkUser;
    public static boolean showSysMessage;
    public static long sendEmail_money;

    public void getmoney(long money) {
        havemoney_gold = money / 10000;
        havemoney_silver = (money - havemoney_gold * 10000) / 100;
        havemoney_copper = money - havemoney_gold * 10000 - havemoney_silver * 100;
//        Tools.printLog("havemoney_gold :::" + havemoney_gold);
//        Tools.printLog("havemoney_silver :::" + havemoney_silver);
//        Tools.printLog("havemoney_copper :::" + havemoney_copper);
    }

    public void updateSendEmail() {
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }

        if (!addgoods) {
            if (checkUser == 0
                    && !showSysMessage) {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "收件人不存在,或是你在对方的黑名单里!");
                showSysMessage = true;
            }
            if (Constant.CMD_MAIL_TYPE == 0) {
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    sendEmail_index = sendEmail_index < (5 + ((emailItems.getGoodsNum() / 4) > 0 ? (emailItems.getGoodsNum() / 4 + 1)
                            : (emailItems.getGoodsNum() / 4))) ? (sendEmail_index + 1) : 0;
                    sendORlist_index = 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    sendEmail_index = sendEmail_index > 0 ? (sendEmail_index - 1) : (5 + ((emailItems.getGoodsNum() / 4) > 0
                            ? (emailItems.getGoodsNum() / 4 + 1) : (emailItems.getGoodsNum() / 4)));
                    sendORlist_index = 0;
                }
            } else {
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    sendEmail_index = sendEmail_index < 3 ? (sendEmail_index + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    sendEmail_index = sendEmail_index > 0 ? (sendEmail_index - 1) : 3;
                }
            }
            if (sendEmail_index == 0) {
                if (Constant.CMD_MAIL_TYPE == 0) {
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                        sendORlist_index = sendORlist_index < 1 ? (sendORlist_index + 1) : 0;
                    }
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                        sendORlist_index = sendORlist_index > 0 ? (sendORlist_index - 1) : 1;
                    }
                } else {
                    sendORlist_index = 0;
                }
                if (sendORlist_index == 0) {//发送
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                        if (Constant.CMD_MAIL_TYPE == 1) {
                            checkUser = 1;
                        }
                        if (sendEmail_text.equals("")) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请填写邮件正文!");
                        } else if (checkUser == 0) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "收件人不存在,或是你在对方的黑名单里!");
                        } else if (checkUser == -1) {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "请填写收件人!");
                        } else {
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_MONEY, Constant.SOCKET_MSG_TYPE_LOGIC);
                        }
                        GameBean.BY_PRE_GAME_UI_STATE = -1;
                    }
                }
                if (sendORlist_index == 1) {//
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                        GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SEND_EMAIL;
                        GameBean.BY_CMD_FRIEND_TYPE = 1;
                        GameBean.b_WAIT_NET_MSG_BACK = true;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_FRIEND_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                }
            }
            if (sendEmail_index == 1 && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
//                this.sStrArray = new String[3];
                SendEmail_State = 1;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "邮件");
                if (Constant.CMD_MAIL_TYPE == 0) {
                    MainLogic.getInstance().inputInterFace.commonInput.setString(sendEmail_name);
                }
                MainLogic.getInstance().inputInterFace.commonInput2.setString(sendEmail_title);
                MainLogic.getInstance().inputInterFace.commonInput3.setString(sendEmail_text);
//                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
//                MainLogic.getInstance().inputInterFace.commonInput2.setString(this.sStrArray[1]);
//                MainLogic.getInstance().inputInterFace.commonInput3.setString(this.sStrArray[2]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
            if (sendEmail_index == 2 && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
//                this.sStrArray = new String[1];
                SendEmail_State = 2;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "邮件");
                if (Constant.CMD_MAIL_TYPE == 0) {
                    MainLogic.getInstance().inputInterFace.commonInput.setString(sendEmail_name);
                }
                MainLogic.getInstance().inputInterFace.commonInput2.setString(sendEmail_title);
                MainLogic.getInstance().inputInterFace.commonInput3.setString(sendEmail_text);
//                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
//                MainLogic.getInstance().inputInterFace.commonInput2.setString(this.sStrArray[1]);
//                MainLogic.getInstance().inputInterFace.commonInput3.setString(this.sStrArray[2]);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
            if (sendEmail_index == 3 && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
//                this.sStrArray = new String[1];
                SendEmail_State = 3;
                MainLogic.getInstance().inputInterFace.setInputInterFace(this.byUiState, "邮件");
//                MainLogic.getInstance().inputInterFace.commonInput.setString(this.sStrArray[0]);
//                MainLogic.getInstance().inputInterFace.commonInput2.setString(this.sStrArray[1]);
//                MainLogic.getInstance().inputInterFace.commonInput3.setString(this.sStrArray[2]);
                if (Constant.CMD_MAIL_TYPE == 0) {
                    MainLogic.getInstance().inputInterFace.commonInput.setString(sendEmail_name);
                }
                MainLogic.getInstance().inputInterFace.commonInput2.setString(sendEmail_title);
                MainLogic.getInstance().inputInterFace.commonInput3.setString(sendEmail_text);
                MainGame.changeCanvas(MainLogic.getInstance().inputInterFace);
            }
            if (sendEmail_index == 4 && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_CHECK_MONEY, Constant.SOCKET_MSG_TYPE_LOGIC);
            }
            if (sendEmail_index >= 5 && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
                addgoods = true;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                if (GameBean.BY_PRE_GAME_UI_STATE == -1) {
                    MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, false);
                } else {
                    switch (GameBean.BY_PRE_GAME_UI_STATE) {
                        case Constant.GAME_UI_ROAM_MENU:
//                            MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM_MENU, true);
                            Tools.openRoamMenu(false, (byte) 1, (byte) 0, 5);
                            break;
                        case Constant.GAME_UI_ROAM:
                        case Constant.GAME_UI_SEND_EMAIL:
                            MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, false);
                            break;
                        case Constant.GAME_UI_FRIEND_LIST:
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_FRIEND_LIST, Constant.SOCKET_MSG_TYPE_LOGIC);
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            break;
                    }
                }

                GameBean.BY_PRE_GAME_UI_STATE = -1;
            }
        } else {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                addgoods_index = addgoods_index < 9 ? (addgoods_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                addgoods_index = addgoods_index > 0 ? (addgoods_index - 1) : 9;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                addgoods_index = addgoods_index < 5 ? (addgoods_index + 5) : (addgoods_index - 5);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                addgoods_index = addgoods_index >= 5 ? (addgoods_index - 5) : (addgoods_index + 5);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {
                MainLogic.getInstance().uiPackage.showBag(Constant.ITEM_COLUMN_TYPE_COMMON);
                GameBean.BY_PRE_GAME_UI_STATE = Constant.GAME_UI_SEND_EMAIL;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                if (items.checkColumnHasGoods((short) addgoods_index)) {
                    items.deleteGoods((short) addgoods_index);
                    isSelected[addgoods_index][0] = -10;
                    isSelected[addgoods_index][1] = -10;
                }
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                addgoods = false;
                emailItems.init((short) items.getGoodsNum(), Constant.ITEM_COLUMN_TYPE_COMMON);
                int j = 0;
                for (int i = 0; i < 10; i++) {
                    if (items.checkColumnHasGoods((short) i)) {
                        items.getGoodsColumnKey((short) i);
                        emailItems.goodsClone((short) j, items, (short) i);
                        j++;
                    }
                }
            }
        }
    }
    public static String[][] ReceiveEmail;
//            = new String[][]{//邮件状态，已读0，未读1，锁定2//发件人//标题//天数//信件ID//有无附件
//    };//邮件状态，已读0，未读1，锁定2//发件人//摘要//正文//天数//信件ID

    public void getReceiveEmail(int index, byte mail_state, String sendmail_name,
            String mail_title, byte mail_days, int mail_id, byte addgoods) {
        ReceiveEmail[index][0] = "" + mail_state;
        ReceiveEmail[index][1] = sendmail_name;
        ReceiveEmail[index][2] = mail_title;
        ReceiveEmail[index][3] = "" + mail_days;
        ReceiveEmail[index][4] = "" + mail_id;
        ReceiveEmail[index][5] = "" + addgoods;
        Tools.printLog(index + "ReceiveEmail[index][0] ::" + ReceiveEmail[index][0]);
        ;
        Tools.printLog(index + "ReceiveEmail[index][1] ::" + ReceiveEmail[index][1]);
        Tools.printLog(index + "ReceiveEmail[index][2] ::" + ReceiveEmail[index][2]);
        Tools.printLog(index + "ReceiveEmail[index][3] ::" + ReceiveEmail[index][3]);
        Tools.printLog(index + "ReceiveEmail[index][4] ::" + ReceiveEmail[index][4]);
        Tools.printLog(index + "ReceiveEmail[index][5] ::" + ReceiveEmail[index][5]);
        Tools.printLog("************************");
    }
    public static int Opeartion_type;

    public void drawReceiveEmail(Graphics g) {
        if (this.imgArray[0] != null) {
//#if NOKIA_S60V5
             Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                     this.imgArray[6], this.imgArray[4], this.imgArray[5], receiveArray[0]);
             int start_Y = 41;
             int font_H = Constant.FONT_SMALL.getHeight();
             Tools.drawShadowString(g, (byte) 1, receiveArray[1], Constant.UI_START_X + 5, start_Y, 0x00E7FF, 0x000000);
             Tools.drawShadowString(g, (byte) 1, receiveArray[2], Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]), start_Y, 0x00E7FF, 0x000000);
             Tools.drawShadowString(g, (byte) 1, receiveArray[3], Constant.UI_START_X + (Constant.SCREEN_WIDTH
                     - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5, start_Y, 0x00E7FF, 0x000000);
             Tools.drawTilePic(g, (byte) 1, 0,
                     start_Y + font_H - this.imgArray[1].getHeight(), Constant.SCREEN_WIDTH, this.imgArray[1],
                     0, 0, this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             g.setColor(0x000000);
             g.drawLine(0, start_Y + font_H, Constant.SCREEN_WIDTH, start_Y + font_H);
 //            //绘制收邮件
             int rect_H = Constant.FONT_SMALL.getHeight() + 2;
             int img_Y = 0;
             if (font_H > 16) {
                 img_Y = (font_H - 16) / 2;
             }
             if (ReceiveEmail != null) {
                 for (int i = 0; i < num_email; i++) {
                     if ((i + Receive_CurrentPage * num_email) < ReceiveEmail.length) {
                         if (ReceiveEmail[i + Receive_CurrentPage * num_email][0] != null) {
                             //绘制邮件状态
                             g.drawRegion(this.imgArray[8], 16 * Integer.parseInt(ReceiveEmail[i + Receive_CurrentPage * num_email][0]),
                                     0, Integer.parseInt(ReceiveEmail[i + Receive_CurrentPage * num_email][0]) == 2 ? 15 : 16, 16, Constant.TRANS_NONE,
                                     Constant.UI_START_X + 2, start_Y + Constant.FONT_SMALL.getHeight() + 4 + img_Y + (rect_H + 1) * i, 0);
                             //绘制发件人
                             Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][1],
                                     30 + Constant.FONT_SMALL.stringWidth("发件人") - Constant.FONT_SMALL.stringWidth("：")) + "：",
                                     Constant.UI_START_X + 2 + 18, start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
                             //绘制标题
                             if (!ReceiveEmail[i + Receive_CurrentPage * num_email][2].equals("")) {
                                 Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][2],
                                         (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5 - 50
                                         - Constant.FONT_SMALL.stringWidth(receiveArray[1])),
                                         Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]),
                                         start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
                             } else {
                                 Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][3],
                                         (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5 - 50
                                         - Constant.FONT_SMALL.stringWidth(receiveArray[1])),
                                         Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]),
                                         start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
                             }
                             //绘制天数
                             Tools.drawShadowString(g, (byte) 1, ReceiveEmail[i + Receive_CurrentPage * num_email][3],
                                     Constant.UI_START_X + (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5,
                                     start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
                         }
                     }
                 }
 //            //绘制翻页
                 getStrParagraphPage(ReceiveEmail, num_email);
                 int iStartY = Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight() - (57 - Constant.FONT_SMALL.getHeight()) / 2;
                 int iStartX = Constant.UI_START_X + ((Constant.SCREEN_WIDTH - 20
                         - Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1) + receiveArray[4] + String.valueOf(Receive_TotalPage))) >> 1);
                 Tools.drawArrow(g, this.imgArray[0], (byte) 1, iStartX, iStartY + ((Constant.FONT_SMALL_HEIGHT - 7) >> 1));
                 Tools.drawShadowString(g, (byte) 1, String.valueOf(Receive_CurrentPage + 1), iStartX + 10, iStartY, 0xFFFFFF, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, receiveArray[4] + String.valueOf(Receive_TotalPage),
                         iStartX + 10 + Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1)), iStartY, 0x00CCFF, 0x000000);
                 Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                         iStartX + 15 + Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1)
                         + receiveArray[4] + String.valueOf(Receive_TotalPage)),
                         iStartY + ((Constant.FONT_SMALL_HEIGHT - 7) >> 1));
 //            //绘制选择
                 if (ReceiveEmail_index < num_email) {
                     Tools.drawTilePic(g, (byte) 1, 0,
                             start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H
                             + (rect_H + 1) * ReceiveEmail_index - this.imgArray[1].getHeight(),
                             Constant.SCREEN_WIDTH, this.imgArray[1],
                             0, 0,
                             this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                     g.setColor(0x000000);
                     g.drawLine(0, start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H + (rect_H + 1) * ReceiveEmail_index,
                             Constant.SCREEN_WIDTH,
                             start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H + (rect_H + 1) * ReceiveEmail_index);
                 }
             }
            //#else
//#            Tools.drawFrame(g,
//#                    Constant.UI_START_X, Constant.UI_START_Y,
//#                    this.imgArray[2], this.imgArray[0],
//#                    this.imgArray[1],
//#                    this.imgArray[7],
//#                    0, 0, 24, 12,
//#                    this.imgArray[7], 49, 0, 23, 12,
//#                    receiveArray[0], 0xFFFFFF);
//#            Tools.drawShadowString(g, (byte) 1, receiveArray[1], Constant.UI_START_X + 5, 22, 0x00E7FF, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, receiveArray[2], Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]), 22, 0x00E7FF, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, receiveArray[3], Constant.UI_START_X + (Constant.SCREEN_WIDTH
//#                    - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5, 22, 0x00E7FF, 0x000000);
//#            Tools.drawTilePic(g, (byte) 1, 0,
//#                    22, Constant.SCREEN_WIDTH, this.imgArray[1],
//#                    0, 0, this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            g.setColor(0x000000);
//#            g.drawLine(0, 22 + this.imgArray[1].getHeight(), Constant.SCREEN_WIDTH, 22 + this.imgArray[1].getHeight());
//#            //绘制收邮件
//#            int rect_H = Constant.FONT_SMALL.getHeight() + 2;
//#            int start_Y = 10;
//#            if (ReceiveEmail != null) {
//#//                Tools.printLog("ReceiveEmail.length   :::" + ReceiveEmail.length);
//#//                System.out.println("num_email  " + num_email);
//#//                System.out.println("num_email  " + Receive_CurrentPage);
//#                for (int i = 0; i < num_email; i++) {
//#//            Tools.printLog("ReceiveEmail[i][0]   "+ReceiveEmail[i][0]);
//#
//#                    if ((i + Receive_CurrentPage * num_email) < ReceiveEmail.length) {
//#                        if (ReceiveEmail[i + Receive_CurrentPage * num_email][0] != null) {
//#                            //绘制邮件状态
//#                            g.drawRegion(this.imgArray[6], 16 * Integer.parseInt(ReceiveEmail[i + Receive_CurrentPage * num_email][0]),
//#                                    0, Integer.parseInt(ReceiveEmail[i + Receive_CurrentPage * num_email][0]) == 2 ? 15 : 16, 16, Constant.TRANS_NONE,
//#                                    Constant.UI_START_X + 2, 21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0);
//#                            //绘制发件人
//#                            Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][1], 30 + Constant.FONT_SMALL.stringWidth("发件人") - Constant.FONT_SMALL.stringWidth("：")) + "：",
//#                                    Constant.UI_START_X + 2 + 18, 21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
//#                            //绘制标题
//#                            if (!ReceiveEmail[i + Receive_CurrentPage * num_email][2].equals("")) {
//#                                Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][2],
//#                                        (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5 - 50
//#                                        - Constant.FONT_SMALL.stringWidth(receiveArray[1])),
//#                                        Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]),
//#                                        21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
//#                            } else {
//#                                Tools.drawShadowString(g, (byte) 1, shortenStr(ReceiveEmail[i + Receive_CurrentPage * num_email][3],
//#                                        (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5 - 50
//#                                        - Constant.FONT_SMALL.stringWidth(receiveArray[1])),
//#                                        Constant.UI_START_X + 50 + Constant.FONT_SMALL.stringWidth(receiveArray[1]),
//#                                        21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
//#                            }
//#                            //绘制天数
//#                            Tools.drawShadowString(g, (byte) 1, ReceiveEmail[i + Receive_CurrentPage * num_email][3],
//#                                    Constant.UI_START_X + (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(receiveArray[3])) - 5,
//#                                    21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + (rect_H + 1) * i, 0xffffff, 0x000000);
//#                        }
//#                    }
//#                }
//#//        Tools.printLog("aa   :::" + shortenStr("我是", Constant.FONT_SMALL.stringWidth("一二三四...")));
//#                //绘制翻页
//#                getStrParagraphPage(ReceiveEmail, num_email);
//#                int iStartY = Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight() - 4;
//#                int iStartX = Constant.UI_START_X + ((Constant.SCREEN_WIDTH - 20
//#                        - Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1) + receiveArray[4] + String.valueOf(Receive_TotalPage))) >> 1);
//#                Tools.drawArrow(g, this.imgArray[0], (byte) 1, iStartX, iStartY + ((Constant.FONT_SMALL_HEIGHT - 7) >> 1));
//#                Tools.drawShadowString(g, (byte) 1, String.valueOf(Receive_CurrentPage + 1), iStartX + 10, iStartY, 0xFFFFFF, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, receiveArray[4] + String.valueOf(Receive_TotalPage),
//#                        iStartX + 10 + Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1)), iStartY, 0x00CCFF, 0x000000);
//#                Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                        iStartX + 15 + Constant.FONT_SMALL.stringWidth(String.valueOf(Receive_CurrentPage + 1)
//#                        + receiveArray[4] + String.valueOf(Receive_TotalPage)),
//#                        iStartY + ((Constant.FONT_SMALL_HEIGHT - 7) >> 1));
//#                //绘制选择
//#                if (ReceiveEmail_index < num_email) {
//#                    Tools.drawTilePic(g, (byte) 1, 0,
//#                            21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H
//#                            + (rect_H + 1) * ReceiveEmail_index - this.imgArray[1].getHeight(),
//#                            Constant.SCREEN_WIDTH, this.imgArray[1],
//#                            0, 0,
//#                            this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                    g.setColor(0x000000);
//#                    g.drawLine(0, 21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H + (rect_H + 1) * ReceiveEmail_index,
//#                            Constant.SCREEN_WIDTH,
//#                            21 + start_Y + Constant.FONT_SMALL.getHeight() + 4 + rect_H + (rect_H + 1) * ReceiveEmail_index);
//#                }
//#            }
            //#endif
        }
        
        
        //Yujiang
        if(mReceiveEmailTouchRect != null)
        	MainView.drawTouchRect(g, mReceiveEmailTouchRect);
        MainView.drawTouchRect(g, mReceiveEmailPageTouchRect);
    }

    public void clearReceiveEmail() {
        this.imgArray = null;
        this.receiveArray = null;
        this.operationArray = null;
        this.str1 = null;
        this.str2 = null;
        this.str3 = null;
        this.str4 = null;
    }
    //String数组分页
    public static int Receive_CurrentPage, Receive_TotalPage;

    public void getStrParagraphPage(String[][] text, int rownum) {
        if (text.length == 0) {
            Receive_TotalPage = 1;
        } else {
            if (text.length % rownum == 0) {
                Receive_TotalPage = text.length / rownum;
            } else {
                Receive_TotalPage = text.length / rownum + 1;
            }
        }

//        Tools.printLog("Receive_TotalPage  :::" + Receive_TotalPage);
//        Tools.printLog("text.length  :::" + text.length);
//        Tools.printLog("rownum  :::" + rownum);
    }

    public String shortenStr(String text, int rowWidth) {
        if (text == null) {
            return text;
        }
        int length = text.length();
        char tempChar;
        int tempLength = 0;
        int iStartX = 0;
        int iStartY = Constant.FONT_SMALL_HEIGHT;
        for (int i = 0; i < length; i++) {
            tempChar = text.charAt(i);
            if (tempLength + Constant.FONT_SMALL.charWidth(tempChar) > rowWidth - Constant.FONT_SMALL.stringWidth("...")) {
                iStartX = 0;
                tempLength = 0;
                text = text.substring(0, i) + "...";
                break;
            }
            tempLength = tempLength + Constant.FONT_SMALL.charWidth(tempChar);
            iStartX = iStartX + Constant.FONT_SMALL.charWidth(tempChar);
        }
        return text;
    }
    private static int num_email;
    public static int ReceiveEmail_index;

    public void updateReceiveEmail() {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            ReceiveEmail_index = ReceiveEmail_index < (num_email - 1) ? (ReceiveEmail_index + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            ReceiveEmail_index = ReceiveEmail_index > 0 ? (ReceiveEmail_index - 1) : (num_email - 1);
        }
//        if (ReceiveEmail_index == num_email) {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
            Receive_CurrentPage = Receive_CurrentPage < (Receive_TotalPage - 1) ? (Receive_CurrentPage + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
            Receive_CurrentPage = Receive_CurrentPage > 0 ? (Receive_CurrentPage - 1) : (Receive_TotalPage - 1);
        }
//        }

        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
            if (ReceiveEmail_index + Receive_CurrentPage * num_email < ReceiveEmail.length) {
                OperationEmail_index = 0;
                delet_Email = false;
                delet_HasreadEmail = false;
                delet_allEmail = false;
                //Yujiang
//                MainLogic.getInstance().pushState(Constant.GAME_UI_OPERATION_EMAIL, true);
                operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
                Tools.printLog("ss  ::" + ReceiveEmail[operationmail_index][4]);
                MainLogic.getInstance().uiEquipment.Opeartion_type = 0;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                /////////////
            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
        }
    }

    public void drawOperationEmail(Graphics g) {
        if (!delet_Email
                && !delet_allEmail
                && !delet_HasreadEmail) {
            int rect_h = Constant.FONT_SMALL.getHeight() * 5 + 14 + 8;
            //#if NOKIA_S60V5
             Tools.drawRoundRect(g, imgArray[9], 0xccb5a1, Constant.SCREEN_WIDTH - 10, rect_h,
                     5, (Constant.SCREEN_HEIGHT - rect_h) / 2);
            //#else
//#            Tools.drawNewFillRect(g, imgArray[5], 7, 7, 7, 7, 5, (Constant.SCREEN_HEIGHT - rect_h) / 2, rect_h, 0xccb5a1);
            //#endif
            for (int i = 0; i < str1.length; i++) {
                Tools.drawShadowString(g, (byte) 1, str1[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                        - Constant.FONT_SMALL.stringWidth(str1[i])) >> 1),
                        (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                        0xffffff, 0x000000);
            }
            //绘制选择
            //#if NOKIA_S60V5
             Tools.drawShadowString(g, (byte) 1, operationArray[1], Constant.UI_START_X + 5,
                     (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7
                     + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index, 0x000000, 0x00E7FF);
             Tools.drawShadowString(g, (byte) 1, operationArray[0], Constant.UI_START_X + (Constant.SCREEN_WIDTH
                     - Constant.FONT_SMALL.stringWidth(operationArray[0])) - 5,
                     (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7
                     + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index, 0x000000, 0x00E7FF);
            //#else
//#            Tools.drawShadowString(g, (byte) 1, operationArray[0], Constant.UI_START_X + 5,
//#                    (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7
//#                    + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index, 0x000000, 0x00E7FF);
//#            Tools.drawShadowString(g, (byte) 1, operationArray[1], Constant.UI_START_X + (Constant.SCREEN_WIDTH
//#                    - Constant.FONT_SMALL.stringWidth(operationArray[1])) - 5,
//#                    (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7
//#                    + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index, 0x000000, 0x00E7FF);
            //#endif
            Tools.drawTilePic(g, (byte) 1, 0,
                    (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7 + Constant.FONT_SMALL.getHeight()
                    + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index - this.imgArray[1].getHeight(),
                    Constant.SCREEN_WIDTH, this.imgArray[1],
                    0, 0,
                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
            g.setColor(0x000000);
            g.drawLine(0, (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7 + Constant.FONT_SMALL.getHeight()
                    + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index,
                    Constant.SCREEN_WIDTH,
                    (Constant.SCREEN_HEIGHT - rect_h) / 2 + 7 + Constant.FONT_SMALL.getHeight()
                    + (Constant.FONT_SMALL.getHeight() + 2) * OperationEmail_index);
        } else if (delet_Email) {
            int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
            //#if NOKIA_S60V5
             Tools.drawRoundRect(g, imgArray[9], 0xccb5a1, Constant.SCREEN_WIDTH - 10, smallrect_h,
                     5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2);
            //#else
//#            Tools.drawNewFillRect(g, imgArray[5], 7, 7, 7, 7, 5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2, smallrect_h, 0xccb5a1);
            //#endif
            for (int i = 0; i < str2.length; i++) {
                if (i < str2.length - 1) {
                    Tools.drawShadowString(g, (byte) 1, str2[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                            - Constant.FONT_SMALL.stringWidth(str2[i])) >> 1),
                            (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                            0xffffff, 0x000000);
                } else {
                    if (isEmailGoods) {
                        Tools.drawShadowString(g, (byte) 1, str2[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                                - Constant.FONT_SMALL.stringWidth(str2[i])) >> 1),
                                (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                                0xffffff, 0x000000);
//                        System.out.println("有附件啊11");
                    }
                }

            }
            Tools.drawShadowString(g, (byte) 1, operationArray[0], 12,
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
            Tools.drawShadowString(g, (byte) 1, operationArray[2], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(operationArray[2]),
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
        } else if (delet_HasreadEmail) {
            int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
            //#if NOKIA_S60V5
             Tools.drawRoundRect(g, imgArray[9], 0xccb5a1, Constant.SCREEN_WIDTH - 10, smallrect_h,
                     5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2);
            //#else
//#            Tools.drawNewFillRect(g, imgArray[5], 7, 7, 7, 7, 5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2, smallrect_h, 0xccb5a1);
            //#endif
            for (int i = 0; i < str3.length; i++) {
                if (i < str3.length - 1) {
                    Tools.drawShadowString(g, (byte) 1, str3[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                            - Constant.FONT_SMALL.stringWidth(str3[i])) >> 1),
                            (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                            0xffffff, 0x000000);
                } else {
                    if (isEmailGoods) {
                        Tools.drawShadowString(g, (byte) 1, str3[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                                - Constant.FONT_SMALL.stringWidth(str3[i])) >> 1),
                                (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                                0xffffff, 0x000000);
//                        System.out.println("有附件啊33");
                    }
                }

            }
            Tools.drawShadowString(g, (byte) 1, operationArray[0], 12,
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
            Tools.drawShadowString(g, (byte) 1, operationArray[2], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(operationArray[2]),
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
        } else if (delet_allEmail) {
            int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
            //#if NOKIA_S60V5
             Tools.drawRoundRect(g, imgArray[9], 0xccb5a1, Constant.SCREEN_WIDTH - 10, smallrect_h,
                     5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2);
            //#else
//#            Tools.drawNewFillRect(g, imgArray[5], 7, 7, 7, 7, 5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2, smallrect_h, 0xccb5a1);
            //#endif
            for (int i = 0; i < str4.length; i++) {
                if (i < str4.length - 1) {
                    Tools.drawShadowString(g, (byte) 1, str4[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                            - Constant.FONT_SMALL.stringWidth(str4[i])) >> 1),
                            (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                            0xffffff, 0x000000);
                } else {
                    if (isEmailGoods) {
                        Tools.drawShadowString(g, (byte) 1, str4[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                                - Constant.FONT_SMALL.stringWidth(str4[i])) >> 1),
                                (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                                0xffffff, 0x000000);
//                        System.out.println("有附件啊44");
                    }
                }

            }
            Tools.drawShadowString(g, (byte) 1, operationArray[0], 12,
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
            Tools.drawShadowString(g, (byte) 1, operationArray[2], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(operationArray[2]),
                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                    deletEmail_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
        }
    }
    public static int OperationEmail_index;
    public static boolean delet_Email, delet_HasreadEmail, delet_allEmail;
    private static int deletEmail_index;
    public static int operationmail_index;//操作的是哪一封邮件

    public void deletHasreadEmail() {
        int num = 0;
        for (int i = 0; i < ReceiveEmail.length; i++) {
            if (ReceiveEmail[i][0].equals("2")
                    || ReceiveEmail[i][0].equals("0")) {
                num += 1;
            }
        }
        String[][] str = new String[num][6];
        int num1 = 0;
        for (int i = 0; i < ReceiveEmail.length; i++) {
            if (ReceiveEmail[i][0].equals("2")
                    || ReceiveEmail[i][0].equals("0")) {
                str[num1][0] = ReceiveEmail[i][0];
                str[num1][1] = ReceiveEmail[i][1];
                str[num1][2] = ReceiveEmail[i][2];
                str[num1][3] = ReceiveEmail[i][3];
                str[num1][4] = ReceiveEmail[i][4];
                str[num1][5] = ReceiveEmail[i][5];
                num1 += 1;
            }
        }
        ReceiveEmail = new String[str.length][6];
        for (int i = 0; i < str.length; i++) {
            ReceiveEmail[i][0] = str[i][0];
            ReceiveEmail[i][1] = str[i][1];
            ReceiveEmail[i][2] = str[i][2];
            ReceiveEmail[i][3] = str[i][3];
            ReceiveEmail[i][4] = str[i][4];
            ReceiveEmail[i][5] = str[i][5];
        }
        for (int i = 0; i < ReceiveEmail.length; i++) {
            Tools.printLog(i + "  ::  " + ReceiveEmail[i][0] + "  ::  " + ReceiveEmail[i][1]);
        }
        Tools.printLog("num ::: " + num);
    }

    public void deletallEmail() {
        int num = 0;
        for (int i = 0; i < ReceiveEmail.length; i++) {
            if (ReceiveEmail[i][0].equals("2")) {
                num += 1;
            }
        }
        String[][] str = new String[num][6];
        int num1 = 0;
        for (int i = 0; i < ReceiveEmail.length; i++) {
            if (ReceiveEmail[i][0].equals("2")) {
                str[num1][0] = ReceiveEmail[i][0];
                str[num1][1] = ReceiveEmail[i][1];
                str[num1][2] = ReceiveEmail[i][2];
                str[num1][3] = ReceiveEmail[i][3];
                str[num1][4] = ReceiveEmail[i][4];
                str[num1][5] = ReceiveEmail[i][5];
                num1 += 1;
            }
        }
        ReceiveEmail = new String[str.length][6];
        for (int i = 0; i < str.length; i++) {
            ReceiveEmail[i][0] = str[i][0];
            ReceiveEmail[i][1] = str[i][1];
            ReceiveEmail[i][2] = str[i][2];
            ReceiveEmail[i][3] = str[i][3];
            ReceiveEmail[i][4] = str[i][4];
            ReceiveEmail[i][5] = str[i][5];
        }
        for (int i = 0; i < ReceiveEmail.length; i++) {
            Tools.printLog(i + "  ::  " + ReceiveEmail[i][0] + "  ::  " + ReceiveEmail[i][1]);
        }
        Tools.printLog("num ::: " + num);
    }

    public void deletonemail(int index) {
        int num = 0;
        String[][] str = new String[ReceiveEmail.length - 1][6];
        for (int i = 0; i < ReceiveEmail.length; i++) {
            if (i != index) {
                str[num][0] = ReceiveEmail[i][0];
                str[num][1] = ReceiveEmail[i][1];
                str[num][2] = ReceiveEmail[i][2];
                str[num][3] = ReceiveEmail[i][3];
                str[num][4] = ReceiveEmail[i][4];
                str[num][5] = ReceiveEmail[i][5];
                num += 1;
            }
        }
        ReceiveEmail = new String[str.length][6];
        for (int i = 0; i < str.length; i++) {
            ReceiveEmail[i][0] = str[i][0];
            ReceiveEmail[i][1] = str[i][1];
            ReceiveEmail[i][2] = str[i][2];
            ReceiveEmail[i][3] = str[i][3];
            ReceiveEmail[i][4] = str[i][4];
            ReceiveEmail[i][5] = str[i][5];
        }
        for (int i = 0; i < ReceiveEmail.length; i++) {
            Tools.printLog(i + "  ::  " + ReceiveEmail[i][0] + "  ::  " + ReceiveEmail[i][1]);
        }
    }
    private boolean isEmailGoods;

    public void updateOperationEmail() {
        if (sMarqueeString != null) {
            if (iPositionX < 0 && Math.abs(iPositionX) > Constant.FONT_SMALL.stringWidth(sMarqueeString)) {
                iPositionX = Constant.UI_START_X + Constant.SCREEN_WIDTH - 10;
            } else {
                iPositionX = iPositionX - 2;
            }
        }
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }

        if (!delet_Email
                && !delet_HasreadEmail
                && !delet_allEmail) {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                OperationEmail_index = OperationEmail_index < 4 ? (OperationEmail_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                OperationEmail_index = OperationEmail_index > 0 ? (OperationEmail_index - 1) : 4;
            }
            if (OperationEmail_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//打开邮件
                operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
                Tools.printLog("ss  ::" + ReceiveEmail[operationmail_index][4]);
                MainLogic.getInstance().uiEquipment.Opeartion_type = 0;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
            }
            if (OperationEmail_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//锁定邮件
//                Tools.printLog("ReceiveEmail_index + Receive_CurrentPage * num_email " + (ReceiveEmail_index + Receive_CurrentPage * num_email));
//                Tools.printLog("ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][0] " + (ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][0]));
                operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
                if (ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][0].equals("1")) {//锁定邮件
                    MainLogic.getInstance().uiEquipment.Opeartion_type = 2;
                    GameBean.b_WAIT_NET_MSG_BACK = true;
                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                    Tools.printLog("锁定邮件111");
                } else if (ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][0].equals("2")) {//解锁邮件
                    MainLogic.getInstance().uiEquipment.Opeartion_type = 3;
                    GameBean.b_WAIT_NET_MSG_BACK = true;
                    MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                    Tools.printLog("解锁邮件111");
                } else {
                    Tools.printLog("只有打开的邮件才能锁定");
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "只有打开的邮件才能锁定!");
                }
            }
            if (OperationEmail_index == 2 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//删除邮件
                if (!ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][0].equals("2")) {
                    isEmailGoods = false;
                    if (ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][5].equals("1")) {
                        isEmailGoods = true;
//                        System.out.println("有附件啊");
                    }
                    delet_Email = true;
                    deletEmail_index = 0;
                } else {
                    MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "邮件已锁定，不能删除！");
                }

            }
            if (OperationEmail_index == 3 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//清空收件箱
                isEmailGoods = false;
                for (int i = 0; i < ReceiveEmail.length; i++) {
//                    邮件状态，已读0，未读1，锁定2
                    if (!ReceiveEmail[i][0].equals("2")) {
                        if (ReceiveEmail[i][5].equals("1")) {
                            isEmailGoods = true;
                            break;
                        }
                    }
                }
                delet_allEmail = true;
                deletEmail_index = 0;
            }
            if (OperationEmail_index == 4 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//清除已读邮件
                isEmailGoods = false;
                for (int i = 0; i < ReceiveEmail.length; i++) {
//                    邮件状态，已读0，未读1，锁定2
                    if (ReceiveEmail[i][0].equals("1")) {
                        if (ReceiveEmail[i][5].equals("1")) {
                            isEmailGoods = true;
//                            System.out.println("已读邮件中有附件");
                            break;
                        }
                    }
                }
                delet_HasreadEmail = true;
                deletEmail_index = 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
            }
        } else if (delet_Email) {//删除邮件
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                deletEmail_index = deletEmail_index < 1 ? (deletEmail_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                deletEmail_index = deletEmail_index > 0 ? (deletEmail_index - 1) : 1;
            }
            if (deletEmail_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
                operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
                MainLogic.getInstance().uiEquipment.Opeartion_type = 4;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                Tools.printLog("删除邮件111");
            }
            if (deletEmail_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
                delet_Email = false;
            }
        } else if (delet_HasreadEmail) {//清除已读邮件
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                deletEmail_index = deletEmail_index < 1 ? (deletEmail_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                deletEmail_index = deletEmail_index > 0 ? (deletEmail_index - 1) : 1;
            }
            if (deletEmail_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
                MainLogic.getInstance().uiEquipment.Opeartion_type = 6;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                Tools.printLog("清除已读邮件111");
            }
            if (deletEmail_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
                delet_HasreadEmail = false;
            }
        } else if (delet_allEmail) {//清空收件箱
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                deletEmail_index = deletEmail_index < 1 ? (deletEmail_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                deletEmail_index = deletEmail_index > 0 ? (deletEmail_index - 1) : 1;
            }
            if (deletEmail_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
                MainLogic.getInstance().uiEquipment.Opeartion_type = 5;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                Tools.printLog("清空收件箱111");
            }
            if (deletEmail_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
                delet_allEmail = false;
            }
        }

    }
    public static String[] ViewEmail;//发件人//标题//内容//钱//附件

    public void getViewEmail(String sendmail_name, String mail_title,
            String mail_content, int mail_money, String mail_accessory, byte mailexpired_days) {
        ViewEmail = new String[6];
        ViewEmail[0] = sendmail_name;
        ViewEmail[1] = mail_title;
        ViewEmail[2] = mail_content;
        ViewEmail[3] = "" + mail_money;
        ViewEmail[4] = mail_accessory;
        ViewEmail[5] = "" + mailexpired_days;
        viewEmail_index = 0;
        viewEmailoperation_index = 0;
        MainLogic.getInstance().pushState(Constant.GAME_UI_VIEW_EMAIL, true);
        sendText_CurrentPage = 0;
        int start_X = 10;
        int start_Y = 21;
        int wordSpacing_H = 2;
//        int rect_h = Constant.SCREEN_HEIGHT - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
//                - (25 + Constant.FONT_SMALL.getHeight() * 3 + 10) - (30 - Constant.FONT_SMALL.getHeight());
        int rect_h = Constant.SCREEN_HEIGHT - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
                - (25 + Constant.FONT_SMALL.getHeight() + 10) - 30;
        sendEmailTextHeight = Tools.getParagraphHeight(ViewEmail[2], Constant.SCREEN_WIDTH - 14, Constant.FONT_SMALL.getHeight());
        getParagraphPage(ViewEmail[2],
                Constant.SCREEN_WIDTH - 14,
                Constant.FONT_SMALL.getHeight(),
                rect_h);
        money_gold = mail_money / 10000;
        money_silver = (mail_money - money_gold * 10000) / 100;
        money_copper = mail_money - money_gold * 10000 - money_silver * 100;
        if (!ViewEmail[4].equals("")) {
            getaccessory(ViewEmail[4]);
        } else {
            getemailItems = new Goods((short) (1), Constant.ITEM_COLUMN_TYPE_COMMON);
        }
        ReceiveEmail[operationmail_index][0] = "1";
        ReceiveEmail[operationmail_index][3] = ViewEmail[5];//过期天数
        //        Tools.printLog("havemoney_gold :::" + money_gold);
        //        Tools.printLog("havemoney_silver :::" + money_silver);
        //        Tools.printLog("havemoney_copper :::" + money_copper);
        //        for (int i = 0; i < 5; i++) {
        //            Tools.printLog(i + "    ::  " + ViewEmail[i]);
        //        }
    }
    public static String[] geta;

    public void getaccessory(String str) {
        char tempChar;
        int tempnum0 = 0;
        int geta_num = 0;
        int items_num = 0;
        geta = new String[70];
        for (int i = 0; i < str.length(); i++) {
            tempChar = str.charAt(i);
            if (tempChar == ',') {
                geta[geta_num] = str.substring(tempnum0, i);
                tempnum0 = i + 1;
                geta_num += 1;
            }
            if (tempChar == '#') {
                geta[geta_num] = str.substring(tempnum0, i);
                tempnum0 = i + 1;
                geta_num += 1;
            }
            if (tempChar == '|') {
                geta[geta_num] = str.substring(tempnum0, i);
                tempnum0 = i + 1;
                geta_num += 1;
                items_num += 1;
            }
        }
        geta[geta_num] = str.substring(tempnum0, str.length());
        Tools.printLog("str ::" + str);
        for (int i = 0; i < geta.length; i++) {
            if (geta[i] != null) {
                Tools.printLog(i + "  ::  " + geta[i]);
            }
        }

        Tools.printLog("items_num ::" + (items_num + 1));
        getemailItems = new Goods((short) (items_num + 1), Constant.ITEM_COLUMN_TYPE_COMMON);
        for (int i = 0; i < (items_num + 1); i++) {
            if (!geta[i * 5].equals("")) {
                getemailItems.addGoods((short) i, true, Long.parseLong(geta[i * 5]), (short) -1, geta[i * 5 + 2],
                        (short) Integer.parseInt(geta[i * 5 + 4]), Integer.parseInt(geta[i * 5 + 1]),
                        (byte) -1, (byte) -1, (byte) -1, (byte) -1, (byte) -1, null, Byte.parseByte(geta[i * 5 + 3]), -1, (byte) -1, null);
            }
        }

    }

    public void drawViewEmail(Graphics g) {
        if (imgArray[0] != null) {
            //#if NOKIA_S60V5
             Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                     this.imgArray[6], this.imgArray[4], this.imgArray[5], viewEmailArray[0]);
             int start_X = 10;
             int start_Y = 41;
             int wordSpacing_H = 2;
             if (sendEmail_index == 0) {
                 long money = money_gold * 10000 + money_silver * 100 + money_copper;
                 if (money > 0
                         || getemailItems.getGoodsNum() > 0) {
                     Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
                             start_Y + wordSpacing_H, viewEmailoperation_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
                 } else {
                     Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
                             start_Y + wordSpacing_H, 0xffffff, 0x000000);
                 }
 
                 Tools.drawShadowString(g, (byte) 1, viewEmailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]),
                         start_Y + wordSpacing_H, viewEmailoperation_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
                 if (viewEmailoperation_index == 0) {
                     Tools.drawArrow(g, this.imgArray[0], (byte) 1, start_X - 8, start_Y + wordSpacing_H + 10);
                     Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                             start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[1]) + 3,
                             start_Y + wordSpacing_H + 10);
                 } else {
                     Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                             Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]) - 8,
                             start_Y + wordSpacing_H + 10);
                     Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                             Constant.SCREEN_WIDTH - start_X + 3,
                             start_Y + wordSpacing_H + 10);
                 }
             } else {
                 Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
                         start_Y + wordSpacing_H, 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, viewEmailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]),
                         start_Y + wordSpacing_H, 0xffffff, 0x000000);
             }
             Tools.drawShadowString(g, (byte) 1, viewEmailArray[3], start_X,
                     start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), viewEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
             Tools.drawShadowString(g, (byte) 1, shortenStr(ViewEmail[0],
                     Constant.SCREEN_WIDTH - 10 - Constant.FONT_SMALL.stringWidth(viewEmailArray[3])),
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[3]),
                     start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), 0xffffff, 0x000000);
             Tools.drawShadowString(g, (byte) 1, viewEmailArray[4], Constant.UI_START_X + start_X,
                     start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, viewEmail_index == 2 ? 0x00E7FF : 0xffffff, 0x000000);
             Tools.drawShadowString(g, (byte) 1, shortenStr(ViewEmail[1],
                     Constant.SCREEN_WIDTH - 10 - Constant.FONT_SMALL.stringWidth(viewEmailArray[4])),
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[4]),
                     start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, 0xffffff, 0x000000);
             Tools.drawShadowString(g, (byte) 1, viewEmailArray[5], start_X,
                     start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 3, sendEmail_index == 3 ? 0x00E7FF : 0xffffff, 0x000000);
             Tools.drawShadowString(g, (byte) 1, viewEmailArray[6], Constant.UI_START_X + start_X,
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30,
                     viewEmail_index == 4 ? 0x00E7FF : 0xffffff, 0x000000);
             //绘制金钱
 
             g.drawRegion(this.imgArray[8], 0, 0, 12, 12, Constant.TRANS_NONE,
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]),
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                     + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
             Tools.drawShadowString(g, (byte) 1, money_gold + viewEmailArray[8], Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 12,
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
             g.drawRegion(this.imgArray[8], 12, 0, 12, 12, Constant.TRANS_NONE,
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 12
                     + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]),
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                     + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
             Tools.drawShadowString(g, (byte) 1, money_silver + viewEmailArray[9],
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 24
                     + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]),
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
             g.drawRegion(this.imgArray[8], 24, 0, 12, 12, Constant.TRANS_NONE,
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 24
                     + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + viewEmailArray[9]),
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8
                     + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
             Tools.drawShadowString(g, (byte) 1, money_copper + viewEmailArray[10],
                     Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 36
                     + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + viewEmailArray[9]),
                     Constant.NEW_END_LINE - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
             //
             Tools.drawShadowString(g, (byte) 1, viewEmailArray[7], start_X,
                     Constant.NEW_END_LINE - 25 - 6 - 30,
                     viewEmail_index < 5 ? 0xffffff : 0x00E7FF, 0x000000);
             if (viewEmail_index < 5) {
                 for (int i = 0; i < 4; i++) {
                     getemailItems.drawGoods(g,
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(viewEmailArray[7]) + ((this.imgArray[9].getWidth() + 7) * 2 + 1) * i,
                             Constant.NEW_END_LINE - 25 - 6
                             - 30,
                             (short) i);
                 }
             } else {
                 for (int i = 0; i < 4; i++) {
                     getemailItems.drawGoods(g,
                             start_X + 2 + Constant.FONT_SMALL.stringWidth(viewEmailArray[7]) + ((this.imgArray[9].getWidth() + 7) * 2 + 1) * i,
                             Constant.NEW_END_LINE - 25 - 6
                             - 30,
                             (short) (i + (viewEmail_index - 5) * 4));
                 }
             }
             Tools.drawArrow(g, this.imgArray[0], (byte) 7, Constant.SCREEN_WIDTH - 7 - 5,
                     Constant.NEW_END_LINE - 25 - 6 - 30);
             Tools.drawArrow(g, this.imgArray[0], (byte) 8, Constant.SCREEN_WIDTH - 7 - 5,
                     Constant.NEW_END_LINE - 25 - 6 + 7 - 30);
             //绘制文本正文背景
             ///////////////////////////////////
             int rect_h = Constant.NEW_END_LINE - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
                     - (25 + Constant.FONT_SMALL.getHeight() + 10) - 30;
             g.setColor(0x000000);
             g.drawRect(5, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4, Constant.SCREEN_WIDTH - 10, rect_h);
             //绘制邮件内容
             Tools.drawHCycleRollingParagraph(g, ViewEmail[2],
                     sendEmailTextHeight, Constant.SCREEN_WIDTH - 14,
                     rect_h, Constant.FONT_SMALL.getHeight(),
                     7, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4,
                     0xffffff, 0x000000);
             if (delet_Email) {
                 int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
                 Tools.drawRoundRect(g, imgArray[11], 0xccb5a1, Constant.SCREEN_WIDTH - 10, smallrect_h,
                         5, (Constant.NEW_END_LINE - smallrect_h) / 2);
                 for (int i = 0; i < str5.length; i++) {
                     if (i < str5.length - 1) {
                         Tools.drawShadowString(g, (byte) 1, str5[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                                 - Constant.FONT_SMALL.stringWidth(str5[i])) >> 1),
                                 (Constant.NEW_END_LINE - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                                 0xffffff, 0x000000);
                     } else {
                         if (isEmailGoods) {
                             Tools.drawShadowString(g, (byte) 1, str5[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
                                     - Constant.FONT_SMALL.stringWidth(str5[i])) >> 1),
                                     (Constant.NEW_END_LINE - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                                     0xffffff, 0x000000);
                         }
                     }
 
                 }
                 Tools.drawShadowString(g, (byte) 1, viewEmailArray[11], 12,
                         (Constant.NEW_END_LINE - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                         deletEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, viewEmailArray[12], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(viewEmailArray[12]),
                         (Constant.NEW_END_LINE - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
                         deletEmail_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
             }
 
             //绘制选择
             int[] choose_y = {
                 start_Y + wordSpacing_H + Constant.FONT_SMALL.getHeight(),//
                 start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2,//
                 start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 3,//
                 start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 4,//
                 Constant.NEW_END_LINE - 25 - 8 - 30,//
                 Constant.NEW_END_LINE - 25 - 6 + 14,//
             };
             if (viewEmail_index < 5) {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         choose_y[viewEmail_index] - this.imgArray[1].getHeight(),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, choose_y[viewEmail_index],
                         Constant.SCREEN_WIDTH, choose_y[viewEmail_index]);
             } else {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         choose_y[5] - this.imgArray[1].getHeight(),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, choose_y[5],
                         Constant.SCREEN_WIDTH, choose_y[5]);
             }
            //#else
//#            Tools.drawFrame(g,
//#                    Constant.UI_START_X, Constant.UI_START_Y,
//#                    this.imgArray[2],
//#                    this.imgArray[0],
//#                    this.imgArray[1],
//#                    this.imgArray[9],
//#                    0, 0, 24, 12,
//#                    this.imgArray[9], 48, 0, 24, 12,
//#                    viewEmailArray[0], 0xFFFFFF);
//#            int start_X = 10;
//#            int start_Y = 21;
//#            int wordSpacing_H = 2;
//#            if (sendEmail_index == 0) {
//#                long money = money_gold * 10000 + money_silver * 100 + money_copper;
//#                if (money > 0
//#                        || getemailItems.getGoodsNum() > 0) {
//#                    Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
//#                            start_Y + wordSpacing_H, viewEmailoperation_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
//#                } else {
//#                    Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
//#                            start_Y + wordSpacing_H, 0xffffff, 0x000000);
//#                }
//#
//#                Tools.drawShadowString(g, (byte) 1, viewEmailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]),
//#                        start_Y + wordSpacing_H, viewEmailoperation_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#                if (viewEmailoperation_index == 0) {
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 1, start_X - 8, start_Y + wordSpacing_H + 7);
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                            start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[1]) + 3,
//#                            start_Y + wordSpacing_H + 7);
//#                } else {
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                            Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]) - 8,
//#                            start_Y + wordSpacing_H + 7);
//#                    Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                            Constant.SCREEN_WIDTH - start_X + 3,
//#                            start_Y + wordSpacing_H + 7);
//#                }
//#            } else {
//#                Tools.drawShadowString(g, (byte) 1, viewEmailArray[1], start_X,
//#                        start_Y + wordSpacing_H, 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, viewEmailArray[2], Constant.SCREEN_WIDTH - start_X - Constant.FONT_SMALL.stringWidth(viewEmailArray[2]),
//#                        start_Y + wordSpacing_H, 0xffffff, 0x000000);
//#            }
//#            Tools.drawShadowString(g, (byte) 1, viewEmailArray[3], start_X,
//#                    start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), viewEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, shortenStr(ViewEmail[0],
//#                    Constant.SCREEN_WIDTH - 10 - Constant.FONT_SMALL.stringWidth(viewEmailArray[3])),
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[3]),
//#                    start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight(), 0xffffff, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, viewEmailArray[4], Constant.UI_START_X + start_X,
//#                    start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, viewEmail_index == 2 ? 0x00E7FF : 0xffffff, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, shortenStr(ViewEmail[1],
//#                    Constant.SCREEN_WIDTH - 10 - Constant.FONT_SMALL.stringWidth(viewEmailArray[4])),
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[4]),
//#                    start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 2, 0xffffff, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, viewEmailArray[5], start_X,
//#                    start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 3, sendEmail_index == 3 ? 0x00E7FF : 0xffffff, 0x000000);
//#            Tools.drawShadowString(g, (byte) 1, viewEmailArray[6], Constant.UI_START_X + start_X,
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30,
//#                    viewEmail_index == 4 ? 0x00E7FF : 0xffffff, 0x000000);
//#            //绘制金钱
//#            g.drawRegion(this.imgArray[5], 0, 0, 12, 12, Constant.TRANS_NONE,
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]),
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                    + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#            Tools.drawShadowString(g, (byte) 1, money_gold + viewEmailArray[8], Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 12,
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#            g.drawRegion(this.imgArray[5], 12, 0, 12, 12, Constant.TRANS_NONE,
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 12
//#                    + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]),
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                    + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#            Tools.drawShadowString(g, (byte) 1, money_silver + viewEmailArray[9],
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 24
//#                    + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]),
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#            g.drawRegion(this.imgArray[5], 24, 0, 12, 12, Constant.TRANS_NONE,
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 24
//#                    + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + viewEmailArray[9]),
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8
//#                    + (Constant.FONT_SMALL.getHeight() - 12) / 2 - 30, 0);
//#            Tools.drawShadowString(g, (byte) 1, money_copper + viewEmailArray[10],
//#                    Constant.UI_START_X + start_X + Constant.FONT_SMALL.stringWidth(viewEmailArray[6]) + 36
//#                    + Constant.FONT_SMALL.stringWidth(money_gold + viewEmailArray[8]) + Constant.FONT_SMALL.stringWidth(money_silver + viewEmailArray[9]),
//#                    Constant.SCREEN_HEIGHT - 25 - Constant.FONT_SMALL.getHeight() - 8 - 30, 0xffffff, 0x000000);
//#            //
//#            Tools.drawShadowString(g, (byte) 1, viewEmailArray[7], start_X,
//#                    Constant.SCREEN_HEIGHT - 25 - 6 - 30,
//#                    viewEmail_index < 5 ? 0xffffff : 0x00E7FF, 0x000000);
//#            if (viewEmail_index < 5) {
//#                for (int i = 0; i < 4; i++) {
//#                    getemailItems.drawGoods(g,
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(viewEmailArray[7]) + (this.imgArray[6].getWidth() * 2 + 1) * i,
//#                            Constant.SCREEN_HEIGHT - 25 - 6
//#                            - 30,
//#                            (short) i);
//#                }
//#            } else {
//#                for (int i = 0; i < 4; i++) {
//#                    getemailItems.drawGoods(g,
//#                            start_X + 2 + Constant.FONT_SMALL.stringWidth(viewEmailArray[7]) + (this.imgArray[6].getWidth() * 2 + 1) * i,
//#                            Constant.SCREEN_HEIGHT - 25 - 6
//#                            - 30,
//#                            (short) (i + (viewEmail_index - 5) * 4));
//#                }
//#            }
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 7, Constant.SCREEN_WIDTH - 7 - 5,
//#                    Constant.SCREEN_HEIGHT - 25 - 6 - 30);
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 8, Constant.SCREEN_WIDTH - 7 - 5,
//#                    Constant.SCREEN_HEIGHT - 25 - 6 + 7 - 30);
//#            //绘制文本正文背景
//#            int rect_h = Constant.SCREEN_HEIGHT - (start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4)
//#                    - (25 + Constant.FONT_SMALL.getHeight() + 10) - 30;
//#            g.setColor(0x000000);
//#            g.drawRect(5, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4, Constant.SCREEN_WIDTH - 10, rect_h);
//#            //绘制邮件内容
//#            Tools.drawHCycleRollingParagraph(g, ViewEmail[2],
//#                    sendEmailTextHeight, Constant.SCREEN_WIDTH - 14,
//#                    rect_h, Constant.FONT_SMALL.getHeight(),
//#                    7, start_Y + wordSpacing_H * 5 + Constant.FONT_SMALL.getHeight() * 4,
//#                    0xffffff, 0x000000);
//#            ////////////////////////////////////
//#            if (delet_Email) {
//#                int smallrect_h = Constant.FONT_SMALL.getHeight() * 4 + 14 + 8;
//#                Tools.drawNewFillRect(g, imgArray[8], 7, 7, 7, 7, 5, (Constant.SCREEN_HEIGHT - smallrect_h) / 2, smallrect_h, 0xccb5a1);
//#                for (int i = 0; i < str5.length; i++) {
//#                    if (i < str5.length - 1) {
//#                        Tools.drawShadowString(g, (byte) 1, str5[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
//#                                - Constant.FONT_SMALL.stringWidth(str5[i])) >> 1),
//#                                (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
//#                                0xffffff, 0x000000);
//#                    } else {
//#                        if (isEmailGoods) {
//#                            Tools.drawShadowString(g, (byte) 1, str5[i], Constant.UI_START_X + ((Constant.SCREEN_WIDTH
//#                                    - Constant.FONT_SMALL.stringWidth(str5[i])) >> 1),
//#                                    (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * i,
//#                                    0xffffff, 0x000000);
//#                        }
//#                    }
//#
//#                }
//#                Tools.drawShadowString(g, (byte) 1, viewEmailArray[11], 12,
//#                        (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//#                        deletEmail_index == 1 ? 0x00E7FF : 0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, viewEmailArray[12], Constant.SCREEN_WIDTH - 12 - Constant.FONT_SMALL.stringWidth(viewEmailArray[12]),
//#                        (Constant.SCREEN_HEIGHT - smallrect_h) / 2 + 7 + (Constant.FONT_SMALL.getHeight() + 2) * 3,
//#                        deletEmail_index == 0 ? 0x00E7FF : 0xffffff, 0x000000);
//#            }
//#
//#            //绘制选择
//#            int[] choose_y = {
//#                start_Y + wordSpacing_H + Constant.FONT_SMALL.getHeight(),//
//#                start_Y + wordSpacing_H * 2 + Constant.FONT_SMALL.getHeight() * 2,//
//#                start_Y + wordSpacing_H * 3 + Constant.FONT_SMALL.getHeight() * 3,//
//#                start_Y + wordSpacing_H * 4 + Constant.FONT_SMALL.getHeight() * 4,//
//#                Constant.SCREEN_HEIGHT - 25 - 8
//#                - 30,//
//#                Constant.SCREEN_HEIGHT - 25 - 6,//
//#            };
//#            if (viewEmail_index < 5) {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        choose_y[viewEmail_index] - this.imgArray[1].getHeight(),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, choose_y[viewEmail_index],
//#                        Constant.SCREEN_WIDTH, choose_y[viewEmail_index]);
//#            } else {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        choose_y[5] - this.imgArray[1].getHeight(),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, choose_y[5],
//#                        Constant.SCREEN_WIDTH, choose_y[5]);
//#            }
            //#endif
        }
        
        //Yujiang
        MainView.drawTouchRect(g, mViewEmailTouchRect);
    }
    public static int viewEmail_index;
    private static int viewEmailoperation_index;

    public void updateViewEmail() {
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }

        if (!delet_Email) {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                viewEmail_index = viewEmail_index < (5 + ((getemailItems.getGoodsNum() / 4) > 0 ? (getemailItems.getGoodsNum() / 4 + 1)
                        : (getemailItems.getGoodsNum() / 4))) ? (viewEmail_index + 1) : 0;
                viewEmailoperation_index = 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                viewEmail_index = viewEmail_index > 0 ? (viewEmail_index - 1) : (5 + ((getemailItems.getGoodsNum() / 4) > 0
                        ? (getemailItems.getGoodsNum() / 4 + 1) : (getemailItems.getGoodsNum() / 4)));
                viewEmailoperation_index = 0;
            }
            if (viewEmail_index == 0) {
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                    viewEmailoperation_index = viewEmailoperation_index < 1 ? (viewEmailoperation_index + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                    viewEmailoperation_index = viewEmailoperation_index > 0 ? (viewEmailoperation_index - 1) : 1;
                }
                if (viewEmailoperation_index == 0) {//
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                        long money = money_gold * 10000 + money_silver * 100 + money_copper;
                        if (money > 0
                                || getemailItems.getGoodsNum() > 0) {//没有附件但是有金钱
                            MainLogic.getInstance().uiEquipment.Opeartion_type = 1;
                            GameBean.b_WAIT_NET_MSG_BACK = true;
                            MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                        } else {//没有可提取的附件
                        }
                    }
                }
                if (viewEmailoperation_index == 1) {//删除邮件
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                            || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
                        isEmailGoods = false;
                        if (ReceiveEmail[ReceiveEmail_index + Receive_CurrentPage * num_email][5].equals("1")) {
                            isEmailGoods = true;
//                            System.out.println("有附件啊");
                        }
                        delet_Email = true;
                        deletEmail_index = 0;
                    }
                }
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                MainLogic.getInstance().pushState(Constant.GAME_UI_RECEIVE_EMAIL, true);
            }
        } else {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                deletEmail_index = deletEmail_index < 1 ? (deletEmail_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                deletEmail_index = deletEmail_index > 0 ? (deletEmail_index - 1) : 1;
            }
            if (deletEmail_index == 1 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定删除
                operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
                MainLogic.getInstance().uiEquipment.Opeartion_type = 4;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
                Tools.printLog("删除邮件111");
            }
            if (deletEmail_index == 0 && MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//取消
                delet_Email = false;
            }
        }
    }
    /**
     * 邮件系统结束
     */
    /**
     * 经脉系统开始
     */
    public int[][] basicMeridians;
    public String[][] basicStr;
    public int[][] iceMeridians;
    public String[][] iceStr;
    public int[][] fireMeridians;
    public String[][] fireStr;
    public int[][] poisonMeridians;
    public String[][] poisonStr;
    private int[][] basicArrow;
    private int[][] iceArrow;
    public static String[][] Meridians_Str;//可以学习的经脉
    public static String[][] Meridianslearn_Str;//已经学习的经脉
    public static int playerPoints;

    public void getMeridiansStr(String str, int num) {
        Meridians_Str[num][0] = str.substring(0, 1);
        Meridians_Str[num][1] = str.substring(1, 3);
        Meridians_Str[num][2] = str.substring(3, 5);
    }

    public void getMeridianslearn_Str(String str, int num) {
        Meridianslearn_Str[num][0] = str.substring(0, 1);
        Meridianslearn_Str[num][1] = str.substring(1, 3);
        Meridianslearn_Str[num][2] = str.substring(3, 5);
    }

    public void drawMeridians(Graphics g) {
        //#if NOKIA_S60V5
         Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                 this.imgArray[6], this.imgArray[4], this.imgArray[5], this.sArray[0]);
         int start_Y = 41;
         int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(meridianArray[1]) * 4) / 5;
         for (int i = 0; i < 4; i++) {
             Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * i,
                     start_Y,
                     meridianschoose_index == i ? 0x00E7FF : 0xffffff, 0x000000);
         }
         g.setColor(0x000000);
         g.drawLine(0, start_Y + 2 + Constant.FONT_SMALL.getHeight(),
                 Constant.SCREEN_WIDTH, start_Y + 2 + Constant.FONT_SMALL.getHeight());
         Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                 str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * meridianschoose_index + cursorCenterOffsetX,
                 start_Y + 10);
         Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                 str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1]) + 5
                 + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * meridianschoose_index - cursorCenterOffsetX,
                 start_Y + 10);
         int pack_H = (Constant.NEW_END_LINE - 46 - Constant.FONT_SMALL.getHeight() - 4 - 30 * 6) / 7;
         int pack_W = 10;
         int package_W = 56;
         int package_H = 36;
         int pack_X = (Constant.SCREEN_WIDTH - package_W * 3 - 20) / 2;
 
         getMeridiansLength();
         if (meridianschoose_index == 0) {
             for (int i = 0; i < 6; i++) {
                 for (int j = 0; j < 3; j++) {
                     if (basicMeridians[i][j] != 0) {
                         g.setColor(0x000000);
                         g.drawRect(pack_X + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, package_W - 1, package_H - 1);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         boolean isdraw = false;
                         for (int a = 0; a < Meridians_Str.length; a++) {
                             if (basicMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
                                 isdraw = true;
                             }
                         }
                         if (isdraw) {
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                     package_W - 2, this.imgArray[10],
                                     0, this.imgArray[10].getHeight() - package_H / 2,
                                     this.imgArray[10].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                     package_W - 2, this.imgArray[10],
                                     0, this.imgArray[10].getHeight() - package_H / 2,
                                     this.imgArray[10].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         }
                         int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
                         int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
                         Tools.drawShadowString(g, (byte) 1, basicStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
                                 0xffffff, 0x000000);
                         String strnum = meridianArray[2] + 0;
                         for (int a = 0; a < Meridianslearn_Str.length; a++) {
                             if (basicMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
                                 strnum = Meridianslearn_Str[a][1];
                             }
                         }
                         if (Integer.parseInt(strnum) != 0) {
                             Tools.drawNumPic(g, this.imgArray[14], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
                                     5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
                         }
                     }
                 }
             }
             //绘制关系箭头
             int Arrow_x = pack_X + package_W - (this.imgArray[15].getWidth() - pack_W) / 2;
             int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[15].getHeight()) / 2;
             int Arrow_x1 = pack_X + (package_W - this.imgArray[15].getHeight()) / 2;
             int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[15].getWidth() - pack_H) / 2;
             for (int i = 0; i < 5; i++) {
                 for (int j = 0; j < 5; j++) {
                     if (basicArrow[i][j] == 1) {
                         if (j % 2 == 1) {
                             g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                     Constant.TRANS_NONE,
                                     Arrow_x + (package_W + pack_W) * (j / 2),
                                     Arrow_y + (package_H + pack_H) * i, 0);
                         }
                         g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                 Constant.TRANS_ROT90,
                                 Arrow_x1 + (package_W + pack_W) * (j / 2),
                                 Arrow_y1 + (package_H + pack_H) * i, 0);
                     }
                 }
             }
             MainView.drawTouchRect(g, skill1);
         } else if (meridianschoose_index == 1) {
             for (int i = 0; i < 3; i++) {
                 for (int j = 0; j < 2; j++) {
                     if (iceMeridians[i][j] != 0) {
                         g.setColor(0x000000);
                         g.drawRect(pack_X + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, package_W - 1, package_H - 1);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         boolean isdraw = false;
                         for (int a = 0; a < Meridians_Str.length; a++) {
                             if (iceMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
                                 isdraw = true;
                             }
                         }
                         if (isdraw) {
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                     package_W - 2, this.imgArray[11],
                                     0, this.imgArray[11].getHeight() - package_H / 2,
                                     this.imgArray[11].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                     package_W - 2, this.imgArray[11],
                                     0, this.imgArray[11].getHeight() - package_H / 2,
                                     this.imgArray[11].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         }
                         int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
                         int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
                         Tools.drawShadowString(g, (byte) 1, iceStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
                                 0xffffff, 0x000000);
                         String strnum = meridianArray[2] + 0;
                         for (int a = 0; a < Meridianslearn_Str.length; a++) {
                             if (iceMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
                                 strnum = Meridianslearn_Str[a][1];
                             }
                         }
                         if (Integer.parseInt(strnum) != 0) {
                             Tools.drawNumPic(g, this.imgArray[14], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
                                     5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
                         }
                     }
                 }
             }
             //绘制关系箭头
             int Arrow_x = pack_X + package_W - (this.imgArray[15].getWidth() - pack_W) / 2;
             int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[15].getHeight()) / 2;
             int Arrow_x1 = pack_X + (package_W - this.imgArray[15].getHeight()) / 2;
             int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[15].getWidth() - pack_H) / 2;
             for (int i = 0; i < 2; i++) {
                 for (int j = 0; j < 3; j++) {
                     if (iceArrow[i][j] == 1) {
                         if (j % 2 == 1) {
                             g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                     Constant.TRANS_NONE,
                                     Arrow_x + (package_W + pack_W) * (j / 2),
                                     Arrow_y + (package_H + pack_H) * i, 0);
                         }
                         g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                 Constant.TRANS_ROT90,
                                 Arrow_x1 + (package_W + pack_W) * (j / 2),
                                 Arrow_y1 + (package_H + pack_H) * i, 0);
                     }
                 }
             }
             MainView.drawTouchRect(g, skill2);
         } else if (meridianschoose_index == 2) {
             for (int i = 0; i < 3; i++) {
                 for (int j = 0; j < 2; j++) {
                     if (fireMeridians[i][j] != 0) {
                         g.setColor(0x000000);
                         g.drawRect(pack_X + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, package_W - 1, package_H - 1);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         boolean isdraw = false;
                         for (int a = 0; a < Meridians_Str.length; a++) {
                             if (fireMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
                                 isdraw = true;
                             }
                         }
                         if (isdraw) {
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                     package_W - 2, this.imgArray[12],
                                     0, this.imgArray[12].getHeight() - package_H / 2,
                                     this.imgArray[12].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                     package_W - 2, this.imgArray[12],
                                     0, this.imgArray[12].getHeight() - package_H / 2,
                                     this.imgArray[12].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         }
                         int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
                         int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
                         Tools.drawShadowString(g, (byte) 1, fireStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
                                 0xffffff, 0x000000);
                         String strnum = meridianArray[2] + 0;
                         for (int a = 0; a < Meridianslearn_Str.length; a++) {
                             if (fireMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
                                 strnum = Meridianslearn_Str[a][1];
                             }
                         }
                         if (Integer.parseInt(strnum) != 0) {
                             Tools.drawNumPic(g, this.imgArray[14], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
                                     5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
                         }
                     }
                 }
             }
             //绘制关系箭头
             int Arrow_x = pack_X + package_W - (this.imgArray[15].getWidth() - pack_W) / 2;
             int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[15].getHeight()) / 2;
             int Arrow_x1 = pack_X + (package_W - this.imgArray[15].getHeight()) / 2;
             int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[15].getWidth() - pack_H) / 2;
             for (int i = 0; i < 2; i++) {
                 for (int j = 0; j < 3; j++) {
                     if (iceArrow[i][j] == 1) {
                         if (j % 2 == 1) {
                             g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                     Constant.TRANS_NONE,
                                     Arrow_x + (package_W + pack_W) * (j / 2),
                                     Arrow_y + (package_H + pack_H) * i, 0);
                         }
                         g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                 Constant.TRANS_ROT90,
                                 Arrow_x1 + (package_W + pack_W) * (j / 2),
                                 Arrow_y1 + (package_H + pack_H) * i, 0);
                     }
                 }
             }
             MainView.drawTouchRect(g, skill2);
         } else if (meridianschoose_index == 3) {
             for (int i = 0; i < 3; i++) {
                 for (int j = 0; j < 2; j++) {
                     if (poisonMeridians[i][j] != 0) {
                         g.setColor(0x000000);
                         g.drawRect(pack_X + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, package_W - 1, package_H - 1);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                         Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                 start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                 package_W - 2, this.imgArray[9],
                                 0, this.imgArray[9].getHeight() - package_H / 2,
                                 this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         boolean isdraw = false;
                         for (int a = 0; a < Meridians_Str.length; a++) {
                             if (poisonMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
                                 isdraw = true;
                             }
                         }
                         if (isdraw) {
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
                                     package_W - 2, this.imgArray[13],
                                     0, this.imgArray[13].getHeight() - package_H / 2,
                                     this.imgArray[13].getWidth(), package_H / 2, Constant.TRANS_ROT180);
                             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
                                     package_W - 2, this.imgArray[13],
                                     0, this.imgArray[13].getHeight() - package_H / 2,
                                     this.imgArray[13].getWidth(), package_H / 2, Constant.TRANS_NONE);
                         }
                         int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
                         int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
                         Tools.drawShadowString(g, (byte) 1, poisonStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
                                 start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
                                 0xffffff, 0x000000);
                         String strnum = meridianArray[2] + 0;
                         for (int a = 0; a < Meridianslearn_Str.length; a++) {
                             if (poisonMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
                                 strnum = Meridianslearn_Str[a][1];
                             }
                         }
                         if (Integer.parseInt(strnum) != 0) {
                             Tools.drawNumPic(g, this.imgArray[14], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
                                     5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
                                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
                         }
                     }
                 }
             }
             //绘制关系箭头
             int Arrow_x = pack_X + package_W - (this.imgArray[15].getWidth() - pack_W) / 2;
             int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[15].getHeight()) / 2;
             int Arrow_x1 = pack_X + (package_W - this.imgArray[15].getHeight()) / 2;
             int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[15].getWidth() - pack_H) / 2;
             for (int i = 0; i < 2; i++) {
                 for (int j = 0; j < 3; j++) {
                     if (iceArrow[i][j] == 1) {
                         if (j % 2 == 1) {
                             g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                     Constant.TRANS_NONE,
                                     Arrow_x + (package_W + pack_W) * (j / 2),
                                     Arrow_y + (package_H + pack_H) * i, 0);
                         }
                         g.drawRegion(this.imgArray[15], 0, 0, this.imgArray[15].getWidth(), this.imgArray[15].getHeight(),
                                 Constant.TRANS_ROT90,
                                 Arrow_x1 + (package_W + pack_W) * (j / 2),
                                 Arrow_y1 + (package_H + pack_H) * i, 0);
                     }
                 }
             }
             MainView.drawTouchRect(g, skill2);
         }
         //绘制选择
         if (meridians_index > 0) {
             //确定返回
             Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                     Constant.UI_START_X + 8,
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - Constant.FONT_SMALL.getHeight() + (package_H + pack_H) * (meridians_index - 1) + 7);
             Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                     Constant.UI_START_X + Constant.SCREEN_WIDTH - 13,
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - Constant.FONT_SMALL.getHeight() + (package_H + pack_H) * (meridians_index - 1) + 7);
             Tools.drawTilePic(g, (byte) 1, 0,
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1) - this.imgArray[1].getHeight(),
                     Constant.SCREEN_WIDTH, this.imgArray[1],
                     0, 0,
                     this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
             g.setColor(0x000000);
             g.drawLine(0, start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1),
                     Constant.SCREEN_WIDTH, start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1));
         }
         if (meridians_index > 0) {
             //格子遮罩
             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * (meridians_index - 1),
                     package_W, this.imgArray[1],
                     0, this.imgArray[1].getHeight() - package_H / 2,
                     this.imgArray[1].getWidth(), package_H / 2, Constant.TRANS_ROT180);
             Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H / 2 + (package_H + pack_H) * (meridians_index - 1),
                     package_W, this.imgArray[1],
                     0, this.imgArray[1].getHeight() - package_H / 2,
                     this.imgArray[1].getWidth(), package_H / 2, Constant.TRANS_NONE);
 
         }
         if (meridians_operationTyte == meridians_operation) {
             Tools.drawPopMenu(g, meridians_operationStr,
                     (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
                     Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) meroperation_index,
                     pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * (meridians_index - 1));
             MainView.drawTouchRect(g, opreationrect);
         }
         if (meridians_operationTyte == meridians_view) {
             if (meridians_index < 4) {
                 if (meridianDesc != null) {
                     int rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
                     if (meridianDesc[1].equals("")
                             || meridianDesc[3].equals("")) {
                         rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
                     } else {
                         rect_h = Constant.FONT_SMALL.getHeight() * 7 + 14;
                     }
                     Tools.drawRoundRect(g, imgArray[3], 0x9c9c9c, Constant.SCREEN_WIDTH - 10, rect_h,
                             5, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 7 - 4 - 7);
 //                    Tools.drawNewFillRect(g, imgArray[3], 8, 8, 7, 7,
 //                            5,
 //                            Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 7 - 4 - 7, rect_h, 0x989898);
                     //
                     if (meridianDesc[1].equals("")) {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
                                 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 - Constant.FONT_SMALL.getHeight(),
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
                     } else if (meridianDesc[3].equals("")) {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
                                 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 - Constant.FONT_SMALL.getHeight(),
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[1], 0xffffff, 0, 0x000000);
                     } else {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
                                 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[1], 0xffffff, 0, 0x000000);
                         int H = Tools.getParagraphHeight(meridianDesc[1], Constant.SCREEN_WIDTH - 14, Constant.FONT_SMALL.getHeight());
                         Tools.drawShadowString(g, (byte) 1, "下一级" + getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
                                 7,
                                 //                                Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 4 - 4 - Constant.FONT_SMALL.getHeight(),
                                 Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 + H,
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7,
                                 //                                Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 3 - 4 - Constant.FONT_SMALL.getHeight(),
                                 Constant.NEW_END_LINE - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 + H,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
                     }
                 }
             } else {
                 if (meridianDesc != null) {
                     int rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
                     if (meridianDesc[1].equals("")
                             || meridianDesc[3].equals("")) {
                         rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
                     } else {
                         rect_h = Constant.FONT_SMALL.getHeight() * 7 + 14;
                     }
                     Tools.drawRoundRect(g, imgArray[3], 0x9c9c9c, Constant.SCREEN_WIDTH - 10, rect_h,
                             5, start_Y);
 //                    Tools.drawNewFillRect(g, imgArray[3], 8, 8, 7, 7,
 //                            5,
 //                            start_Y, rect_h, 0x989898);
                     if (meridianDesc[1].equals("")) {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
                                 7, start_Y + 7,
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
                     } else if (meridianDesc[3].equals("")) {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
                                 7, start_Y + 7,
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[1], 0xffffff, 0, 0x000000);
                     } else {
                         Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
                                 7, start_Y + 7,
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[1], 0xffffff, 0, 0x000000);
                         int H = Tools.getParagraphHeight(meridianDesc[1], Constant.SCREEN_WIDTH - 14, Constant.FONT_SMALL.getHeight());
 
                         Tools.drawShadowString(g, (byte) 1, "下一级" + getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
                                 7,
                                 //                                start_Y + Constant.FONT_SMALL.getHeight() * 3 + 7,
                                 start_Y + Constant.FONT_SMALL.getHeight() * 1 + 7 + H,
                                 0x00E7FF, 0x000000);
                         Tools.drawParagraph(g, 7,
                                 //                                start_Y + Constant.FONT_SMALL.getHeight() * 4 + 7,
                                 start_Y + Constant.FONT_SMALL.getHeight() * 2 + 7 + H,
                                 Constant.SCREEN_WIDTH - 14,
                                 meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
                     }
                 }
             }
         }
         String strDesc = "当前修为值" + playerPoints + "点";
         Tools.drawShadowString(g, (byte) 1, strDesc,
                 (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(strDesc)) / 2,
                 Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight() - (56 - Constant.FONT_SMALL.getHeight()) / 2,
                 0xffffff, 0x000000);
         MainView.drawTouchRect(g, skilltop);
 
        //#else
        //#if NOKIA_E72
//#         Tools.drawE72Frame(g, this.imgArray[2], this.imgArray[12], meridianArray[0]);
        //#else
//#        Tools.drawFrame(g,
//#                Constant.UI_START_X, Constant.UI_START_Y,
//#                this.imgArray[2], this.imgArray[0],
//#                this.imgArray[1],
//#                this.imgArray[7],
//#                0, 0, 24, 12,
//#                this.imgArray[7], 49, 0, 23, 12,
//#                meridianArray[0], 0xFFFFFF);
        //#endif
//#        int start_Y = 21;
//#        int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(meridianArray[1]) * 4) / 5;
//#        for (int i = 0; i < 4; i++) {
//#            Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * i,
//#                    start_Y,
//#                    meridianschoose_index == i ? 0x00E7FF : 0xffffff, 0x000000);
//#        }
//#        g.setColor(0x000000);
//#        g.drawLine(0, start_Y + Constant.FONT_SMALL.getHeight(),
//#                Constant.SCREEN_WIDTH, start_Y + Constant.FONT_SMALL.getHeight());
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * meridianschoose_index + cursorCenterOffsetX,
//#                start_Y + 7);
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1]) + 5
//#                + (str_interval + Constant.FONT_SMALL.stringWidth(meridianArray[1])) * meridianschoose_index - cursorCenterOffsetX,
//#                start_Y + 7);
//#        int package_H = 28;
//#        int pack_H = (Constant.SCREEN_HEIGHT - 46 - Constant.FONT_SMALL.getHeight() - 2 - package_H * 6) / 7;
//#        int pack_W = 10;
//#        int pack_X = (Constant.SCREEN_WIDTH - 40 * 3 - 20) / 2;
//#        int package_W = 40;
//#
//#        getMeridiansLength();
//#        if (meridianschoose_index == 0) {
//#            for (int i = 0; i < 6; i++) {
//#                for (int j = 0; j < 3; j++) {
//#                    if (basicMeridians[i][j] != 0) {
//#                        g.setColor(0x000000);
//#                        g.drawRect(pack_X + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, 39, package_H - 1);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        boolean isdraw = false;
//#                        for (int a = 0; a < Meridians_Str.length; a++) {
//#                            if (basicMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
//#                                isdraw = true;
//#                            }
//#                        }
//#                        if (isdraw) {
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                    38, this.imgArray[8],
//#                                    0, this.imgArray[8].getHeight() - package_H / 2,
//#                                    this.imgArray[8].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                    38, this.imgArray[8],
//#                                    0, this.imgArray[8].getHeight() - package_H / 2,
//#                                    this.imgArray[8].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        }
//#                        int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
//#                        int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
//#                        Tools.drawShadowString(g, (byte) 1, basicStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
//#                                0xffffff, 0x000000);
//#                        String strnum = meridianArray[2] + 0;
//#                        for (int a = 0; a < Meridianslearn_Str.length; a++) {
//#                            if (basicMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
//#                                strnum = Meridianslearn_Str[a][1];
//#                            }
//#                        }
//#                        if (Integer.parseInt(strnum) != 0) {
//#                            Tools.drawNumPic(g, this.imgArray[5], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
//#                                    5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
//#                        }
//#                    }
//#                }
//#            }
//#            //绘制关系箭头
//#            int Arrow_x = pack_X + package_W - (this.imgArray[6].getWidth() - pack_W) / 2;
//#            int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_x1 = pack_X + (package_W - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[6].getWidth() - pack_H) / 2;
//#            for (int i = 0; i < 5; i++) {
//#                for (int j = 0; j < 5; j++) {
//#                    if (basicArrow[i][j] == 1) {
//#                        if (j % 2 == 1) {
//#                            g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                    Constant.TRANS_NONE,
//#                                    Arrow_x + (package_W + pack_W) * (j / 2),
//#                                    Arrow_y + (package_H + pack_H) * i, 0);
//#                        }
//#                        g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                Constant.TRANS_ROT90,
//#                                Arrow_x1 + (package_W + pack_W) * (j / 2),
//#                                Arrow_y1 + (package_H + pack_H) * i, 0);
//#                    }
//#                }
//#            }
//#        } else if (meridianschoose_index == 1) {
//#            for (int i = 0; i < 3; i++) {
//#                for (int j = 0; j < 2; j++) {
//#                    if (iceMeridians[i][j] != 0) {
//#                        g.setColor(0x000000);
//#                        g.drawRect(pack_X + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, 39, package_H - 1);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        //////
//#                        boolean isdraw = false;
//#                        for (int a = 0; a < Meridians_Str.length; a++) {
//#                            if (iceMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
//#                                isdraw = true;
//#                            }
//#                        }
//#                        if (isdraw) {
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                    38, this.imgArray[9],
//#                                    0, this.imgArray[9].getHeight() - package_H / 2,
//#                                    this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                    38, this.imgArray[9],
//#                                    0, this.imgArray[9].getHeight() - package_H / 2,
//#                                    this.imgArray[9].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        }
//#                        int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
//#                        int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
//#                        Tools.drawShadowString(g, (byte) 1, iceStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
//#                                0xffffff, 0x000000);
//#                        String strnum = meridianArray[2] + 0;
//#                        for (int a = 0; a < Meridianslearn_Str.length; a++) {
//#                            if (iceMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
//#                                strnum = Meridianslearn_Str[a][1];
//#                            }
//#                        }
//#                        if (Integer.parseInt(strnum) != 0) {
//#                            Tools.drawNumPic(g, this.imgArray[5], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
//#                                    5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
//#                        }
//#                    }
//#                }
//#            }
//#            //绘制关系箭头
//#            int Arrow_x = pack_X + package_W - (this.imgArray[6].getWidth() - pack_W) / 2;
//#            int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_x1 = pack_X + (package_W - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[6].getWidth() - pack_H) / 2;
//#            for (int i = 0; i < 2; i++) {
//#                for (int j = 0; j < 3; j++) {
//#                    if (iceArrow[i][j] == 1) {
//#                        if (j % 2 == 1) {
//#                            g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                    Constant.TRANS_NONE,
//#                                    Arrow_x + (package_W + pack_W) * (j / 2),
//#                                    Arrow_y + (package_H + pack_H) * i, 0);
//#                        }
//#                        g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                Constant.TRANS_ROT90,
//#                                Arrow_x1 + (package_W + pack_W) * (j / 2),
//#                                Arrow_y1 + (package_H + pack_H) * i, 0);
//#                    }
//#                }
//#            }
//#        } else if (meridianschoose_index == 2) {
//#            for (int i = 0; i < 3; i++) {
//#                for (int j = 0; j < 2; j++) {
//#                    if (fireMeridians[i][j] != 0) {
//#                        g.setColor(0x000000);
//#                        g.drawRect(pack_X + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, 39, package_H - 1);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        boolean isdraw = false;
//#                        for (int a = 0; a < Meridians_Str.length; a++) {
//#                            if (fireMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
//#                                isdraw = true;
//#                            }
//#                        }
//#                        if (isdraw) {
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                    38, this.imgArray[10],
//#                                    0, this.imgArray[10].getHeight() - package_H / 2,
//#                                    this.imgArray[10].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                    38, this.imgArray[10],
//#                                    0, this.imgArray[10].getHeight() - package_H / 2,
//#                                    this.imgArray[10].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        }
//#                        int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
//#                        int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
//#                        Tools.drawShadowString(g, (byte) 1, fireStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
//#                                0xffffff, 0x000000);
//#                        String strnum = meridianArray[2] + 0;
//#                        for (int a = 0; a < Meridianslearn_Str.length; a++) {
//#                            if (fireMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
//#                                strnum = Meridianslearn_Str[a][1];
//#                            }
//#                        }
//#                        if (Integer.parseInt(strnum) != 0) {
//#                            Tools.drawNumPic(g, this.imgArray[5], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
//#                                    5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
//#                        }
//#                    }
//#                }
//#            }
//#            //绘制关系箭头
//#            int Arrow_x = pack_X + package_W - (this.imgArray[6].getWidth() - pack_W) / 2;
//#            int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_x1 = pack_X + (package_W - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[6].getWidth() - pack_H) / 2;
//#            for (int i = 0; i < 2; i++) {
//#                for (int j = 0; j < 3; j++) {
//#                    if (iceArrow[i][j] == 1) {
//#                        if (j % 2 == 1) {
//#                            g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                    Constant.TRANS_NONE,
//#                                    Arrow_x + (package_W + pack_W) * (j / 2),
//#                                    Arrow_y + (package_H + pack_H) * i, 0);
//#                        }
//#                        g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                Constant.TRANS_ROT90,
//#                                Arrow_x1 + (package_W + pack_W) * (j / 2),
//#                                Arrow_y1 + (package_H + pack_H) * i, 0);
//#                    }
//#                }
//#            }
//#        } else if (meridianschoose_index == 3) {
//#            for (int i = 0; i < 3; i++) {
//#                for (int j = 0; j < 2; j++) {
//#                    if (poisonMeridians[i][j] != 0) {
//#                        g.setColor(0x000000);
//#                        g.drawRect(pack_X + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i, 39, package_H - 1);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                        Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                38, this.imgArray[4],
//#                                0, this.imgArray[4].getHeight() - package_H / 2,
//#                                this.imgArray[4].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        boolean isdraw = false;
//#                        for (int a = 0; a < Meridians_Str.length; a++) {
//#                            if (poisonMeridians[i][j] == Integer.parseInt(Meridians_Str[a][2])) {
//#                                isdraw = true;
//#                            }
//#                        }
//#                        if (isdraw) {
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + 1,
//#                                    38, this.imgArray[11],
//#                                    0, this.imgArray[11].getHeight() - package_H / 2,
//#                                    this.imgArray[11].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#                            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * j + 1,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * i + package_H / 2 - 1,
//#                                    38, this.imgArray[11],
//#                                    0, this.imgArray[11].getHeight() - package_H / 2,
//#                                    this.imgArray[11].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#                        }
//#                        int str_x = (package_W - Constant.FONT_SMALL.stringWidth(meridianArray[1])) / 2;
//#                        int str_y = (package_H - Constant.FONT_SMALL.getHeight()) / 2;
//#                        Tools.drawShadowString(g, (byte) 1, poisonStr[i][j], pack_X + str_x + (package_W + pack_W) * j,
//#                                start_Y + Constant.FONT_SMALL.getHeight() + str_y + pack_H + (package_H + pack_H) * i,
//#                                0xffffff, 0x000000);
//#                        String strnum = meridianArray[2] + 0;
//#                        for (int a = 0; a < Meridianslearn_Str.length; a++) {
//#                            if (poisonMeridians[i][j] == Integer.parseInt(Meridianslearn_Str[a][2])) {
//#                                strnum = Meridianslearn_Str[a][1];
//#                            }
//#                        }
//#                        if (Integer.parseInt(strnum) != 0) {
//#                            Tools.drawNumPic(g, this.imgArray[5], meridianArray[2] + Integer.parseInt(strnum), 1, 50,
//#                                    5, 7, pack_X + 1 + package_W + (package_W + pack_W) * j,
//#                                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * i, Graphics.BOTTOM | Graphics.RIGHT);
//#                        }
//#                    }
//#                }
//#            }
//#            //绘制关系箭头
//#            int Arrow_x = pack_X + package_W - (this.imgArray[6].getWidth() - pack_W) / 2;
//#            int Arrow_y = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_x1 = pack_X + (package_W - this.imgArray[6].getHeight()) / 2;
//#            int Arrow_y1 = start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - (this.imgArray[6].getWidth() - pack_H) / 2;
//#            for (int i = 0; i < 2; i++) {
//#                for (int j = 0; j < 3; j++) {
//#                    if (iceArrow[i][j] == 1) {
//#                        if (j % 2 == 1) {
//#                            g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                    Constant.TRANS_NONE,
//#                                    Arrow_x + (package_W + pack_W) * (j / 2),
//#                                    Arrow_y + (package_H + pack_H) * i, 0);
//#                        }
//#                        g.drawRegion(this.imgArray[6], 0, 0, this.imgArray[6].getWidth(), this.imgArray[6].getHeight(),
//#                                Constant.TRANS_ROT90,
//#                                Arrow_x1 + (package_W + pack_W) * (j / 2),
//#                                Arrow_y1 + (package_H + pack_H) * i, 0);
//#                    }
//#                }
//#            }
//#        }
//#        //绘制选择
//#        if (meridians_index > 0) {
//#            //确定返回
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                    Constant.UI_START_X + 8,
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - Constant.FONT_SMALL.getHeight() + (package_H + pack_H) * (meridians_index - 1) + 7);
//#            Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                    Constant.UI_START_X + Constant.SCREEN_WIDTH - 13,
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H - Constant.FONT_SMALL.getHeight() + (package_H + pack_H) * (meridians_index - 1) + 7);
//#            Tools.drawTilePic(g, (byte) 1, 0,
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1) - this.imgArray[1].getHeight(),
//#                    Constant.SCREEN_WIDTH, this.imgArray[1],
//#                    0, 0,
//#                    this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#            g.setColor(0x000000);
//#            g.drawLine(0, start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1),
//#                    Constant.SCREEN_WIDTH, start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H + (package_H + pack_H) * (meridians_index - 1));
//#        }
//#        if (meridians_index > 0) {
//#            //格子遮罩
//#            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * (meridians_index - 1),
//#                    package_W, this.imgArray[1],
//#                    0, this.imgArray[1].getHeight() - package_H / 2,
//#                    this.imgArray[1].getWidth(), package_H / 2, Constant.TRANS_ROT180);
//#            Tools.drawTilePic(g, (byte) 1, pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + package_H / 2 + (package_H + pack_H) * (meridians_index - 1),
//#                    package_W, this.imgArray[1],
//#                    0, this.imgArray[1].getHeight() - package_H / 2,
//#                    this.imgArray[1].getWidth(), package_H / 2, Constant.TRANS_NONE);
//#        }
//#        if (meridians_operationTyte == meridians_operation) {
//#            Tools.drawPopMenu(g, meridians_operationStr,
//#                    (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
//#                    Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) meroperation_index,
//#                    pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
//#                    start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * (meridians_index - 1));
//#        }
//#        if (meridians_operationTyte == meridians_view) {
//#            if (meridians_index < 4) {
//#                if (meridianDesc != null) {
//#                    int rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
//#                    if (meridianDesc[1].equals("")
//#                            || meridianDesc[3].equals("")) {
//#                        rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
//#                    } else {
//#                        rect_h = Constant.FONT_SMALL.getHeight() * 7 + 14;
//#                    }
//#
//#                    Tools.drawNewFillRect(g, imgArray[3], 8, 8, 7, 7,
//#                            5,
//#                            Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 7 - 4 - 7, rect_h, 0x989898);
//#                    //
//#                    if (meridianDesc[1].equals("")) {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
//#                                7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 - Constant.FONT_SMALL.getHeight(),
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
//#                    } else if (meridianDesc[3].equals("")) {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
//#                                7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 - Constant.FONT_SMALL.getHeight(),
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[1], 0xffffff, 0, 0x000000);
//#                    } else {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
//#                                7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 - Constant.FONT_SMALL.getHeight(),
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[1], 0xffffff, 0, 0x000000);
//#                        int H = Tools.getParagraphHeight(meridianDesc[1], Constant.SCREEN_WIDTH - 14, Constant.FONT_SMALL.getHeight());
//#                        Tools.drawShadowString(g, (byte) 1, "下一级" + getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
//#                                7,
//#                                Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 6 - 4 + H,
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7,
//#                                Constant.SCREEN_HEIGHT - 27 - Constant.FONT_SMALL.getHeight() * 5 - 4 + H,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
//#                    }
//#                }
//#            } else {
//#                if (meridianDesc != null) {
//#                    int rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
//#                    if (meridianDesc[1].equals("")
//#                            || meridianDesc[3].equals("")) {
//#                        rect_h = Constant.FONT_SMALL.getHeight() * 4 + 14;
//#                    } else {
//#                        rect_h = Constant.FONT_SMALL.getHeight() * 7 + 14;
//#                    }
//#                    Tools.drawNewFillRect(g, imgArray[3], 8, 8, 7, 7,
//#                            5,
//#                            start_Y, rect_h, 0x989898);
//#                    if (meridianDesc[1].equals("")) {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
//#                                7, start_Y + 7,
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
//#                    } else if (meridianDesc[3].equals("")) {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
//#                                7, start_Y + 7,
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[1], 0xffffff, 0, 0x000000);
//#                    } else {
//#                        Tools.drawShadowString(g, (byte) 1, getMeridiansName + Integer.parseInt(getMeridiansLevel) + "级：",
//#                                7, start_Y + 7,
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7, start_Y + Constant.FONT_SMALL.getHeight() + 7,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[1], 0xffffff, 0, 0x000000);
//#                        int H = Tools.getParagraphHeight(meridianDesc[1], Constant.SCREEN_WIDTH - 14, Constant.FONT_SMALL.getHeight());
//#
//#                        Tools.drawShadowString(g, (byte) 1, "下一级" + getMeridiansName + (Integer.parseInt(getMeridiansLevel) + 1) + "级：",
//#                                7,
//#                                start_Y + Constant.FONT_SMALL.getHeight() * 1 + 7 + H,
//#                                0x00E7FF, 0x000000);
//#                        Tools.drawParagraph(g, 7,
//#                                start_Y + Constant.FONT_SMALL.getHeight() * 2 + 7 + H,
//#                                Constant.SCREEN_WIDTH - 14,
//#                                meridianDesc[3] + "需要" + meridianDesc[2] + "修为。", 0xffffff, 0, 0x000000);
//#                    }
//#                }
//#            }
//#        }
//#        String strDesc = "当前修为值" + playerPoints + "点";
//#        Tools.drawShadowString(g, (byte) 1, strDesc,
//#                (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(strDesc)) / 2,
//#                Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight() - (25 - Constant.FONT_SMALL.getHeight()) / 2,
//#                0xffffff, 0x000000);
//#
//#
//#//        }
        //#endif
    }
    private static int[][] skill1,skill2,skill3,skill4,skilltop,opreationrect;
    public void checkTouchMeridians(int x, int y) {
        switch (meridians_operationTyte) {
        case meridians_interface:
        	if (skilltop == null) {
        		skilltop = new int[][]{
        				{8,41,87,20},
        				{95,41,85,20},
        				{180,41,80,20},
        				{255,41,87,20},
        		};
        	}
        	int touched = MainCanvas.checkTouch(x, y, skilltop);
        	if (touched >= 0) {
                meridians_index = 0;
                meridiansOperation_index = 0;
                MaxOperation_index = 0;
                startNum = 0;
                meridianschoose_index = touched;
                getMeridiansLength();
                meridians_index = 0;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_MERIDIAN, Constant.SOCKET_MSG_TYPE_LOGIC);
			} else {
				switch (meridianschoose_index) {
				case 0:
					if (skill1 == null) {
						skill1 = new int[][] {
								{ 86, 79, 54, 35 },
								{ 152, 79, 54, 35 },
								// /////////////////
								{ 86, 137, 54, 35 },
								{ 152, 137, 54, 35 },
								{ 218, 137, 54, 35 },
								// /////////////////
								{ 86, 195, 54, 35 }, { 152, 195, 54, 35 },
								{ 218, 195, 54, 35 },
								// /////////////////
								{ 86, 253, 54, 35 }, { 152, 253, 54, 35 },
								{ 218, 253, 54, 35 },
								// /////////////////
								{ 86, 311, 54, 35 }, { 152, 311, 54, 35 },
								// {218,253,54,35},
								// /////////////////
								{ 86, 369, 54, 35 }, { 152, 369, 54, 35 },
						// {218,253,54,35},
						};
					}
					touched = MainCanvas.checkTouch(x, y, skill1);
					if (touched >= 0) {
						if (touched == 0 || touched == 1) {
							meridians_index = 1;
						} else if (touched == 2 || touched == 3 || touched == 4) {
							meridians_index = 2;
						} else if (touched == 5 || touched == 6 || touched == 7) {
							meridians_index = 3;
						} else if (touched == 8 || touched == 9
								|| touched == 10) {
							meridians_index = 4;
						} else if (touched == 11 || touched == 12) {
							meridians_index = 5;
						} else if (touched == 13 || touched == 14) {
							meridians_index = 6;
						}
						// ///////////////////////////////////
						meridiansOperation_index = 0;
						MaxOperation_index = 0;
						startNum = 0;
						if (meridians_index > 0) {
							meridiansOperation();
						}
						// ///////////////////////////////////
						if (touched == 0 || touched == 1) {
							meridiansOperation_index = touched;
						} else if (touched == 2 || touched == 3 || touched == 4) {
							meridiansOperation_index = touched - 2;
						} else if (touched == 5 || touched == 6 || touched == 7) {
							meridiansOperation_index = touched - 5;
						} else if (touched == 8 || touched == 9
								|| touched == 10) {
							meridiansOperation_index = touched - 8;
						} else if (touched == 11 || touched == 12) {
							meridiansOperation_index = touched - 11;
						} else if (touched == 13 || touched == 14) {
							meridiansOperation_index = touched - 13;
						}
						MainCanvas.pressFire();
					}
					break;
				case 1:
				case 2:
				case 3:
					if (skill2 == null) {
						skill2 = new int[][] { { 86, 79, 55, 35 },
								{ 86, 137, 55, 35 }, { 152, 137, 55, 35 },
								{ 86, 195, 55, 35 }, { 152, 195, 55, 35 }, };
					}
					touched = MainCanvas.checkTouch(x, y, skill2);
					if (touched >= 0) {
						if (touched == 0) {
							meridians_index = 1;
						} else if (touched == 1 || touched == 2) {
							meridians_index = 2;
						} else {
							meridians_index = 3;
						}
						// ///////////////////////////////////
						meridiansOperation_index = 0;
						MaxOperation_index = 0;
						startNum = 0;
						if (meridians_index > 0) {
							meridiansOperation();
						}
						// ///////////////////////////////////
						if (touched == 0) {
							meridiansOperation_index = 0;
						} else if (touched == 1 || touched == 2) {
							meridiansOperation_index = touched - 1;
						} else {
							meridiansOperation_index = touched - 3;
						}
						// meridiansOperation_index = touched;
						MainCanvas.pressFire();
					}
					break;
				// case 2:
				// break;
				// case 3:
				// break;
				}
				MainCanvas.checkSoftKey();
			}
        	break;
        case meridians_operation:
            int pack_H = (Constant.NEW_END_LINE - 46 - Constant.FONT_SMALL.getHeight() - 4 - 30 * 6) / 7;
            int pack_W = 10;
            int package_W = 56;
            int package_H = 36;
            int start_Y = 41;
        	int pack_X = (Constant.SCREEN_WIDTH - package_W * 3 - 20) / 2;
        	opreationrect = Tools.getPopMenuTouch(meridians_operationStr,
                     (byte) 1, Constant.FONT_SMALL.stringWidth("查看") + 2,
                     Constant.FONT_SMALL_HEIGHT + 1, 0x000000, 0xFFFFFF, 0x00CCFF, (byte) meroperation_index,
                     pack_X + (package_W + pack_W) * (meridiansOperation_index + startNum),
                     start_Y + Constant.FONT_SMALL.getHeight() + pack_H + (package_H + pack_H) * (meridians_index - 1));
//        	MainCanvas.checkSoftKey();
        	touched = MainCanvas.checkTouch(pack_X, start_Y, opreationrect);
        	if (touched >= 0) {
        		meroperation_index = touched;
        		MainCanvas.pressFire();
        	} else {
        		MainCanvas.pressBack();
        	}
        	break;
        case meridians_view:
        	MainCanvas.checkSoftKey();
        	break;
        }
    }

    public void clearMeridians() {
        this.imgArray = null;
        this.sArray = null;
        basicMeridians = null;
        basicStr = null;
        iceMeridians = null;
        iceStr = null;
        fireMeridians = null;
        fireStr = null;
        poisonMeridians = null;
        poisonStr = null;
        basicArrow = null;
        iceArrow = null;
        this.meridianArray = null;
    }
    public static String getMeridiansKey, getMeridiansLevel, getMeridiansName;
    private boolean isLearnMer;

    public void getMeridiansKey(int learnORdesc) {
        if (learnORdesc == 0) {//学习
            isLearnMer = false;
            if (meridianschoose_index == 0) {
                String str0 = "0";
                String str1 = "00";
                for (int i = 0; i < Meridians_Str.length; i++) {
                    if (basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridians_Str[i][2])) {
                        str1 = Meridians_Str[i][1];
                        break;
                    }
                }
                if (Integer.parseInt(str1) == 0) {
                    isLearnMer = true;
                    str1 = "01";
                    for (int i = 0; i < Meridianslearn_Str.length; i++) {
                        if (basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                            str1 = Meridianslearn_Str[i][1];
                        }
                    }
                }
                String str2 = "00";
                if (basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }

                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = basicStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 1) {
                String str0 = "1";
                String str1 = "00";
                for (int i = 0; i < Meridians_Str.length; i++) {
                    if (iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridians_Str[i][2])) {
                        str1 = Meridians_Str[i][1];
                        Tools.printLog("111   :::  " + str1);
                        break;
                    }
                }
                if (Integer.parseInt(str1) == 0) {
                    isLearnMer = true;
                    str1 = "01";
                    for (int i = 0; i < Meridianslearn_Str.length; i++) {
                        if (iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                            str1 = Meridianslearn_Str[i][1];
                            Tools.printLog("222   :::  " + str1);
                        }
                    }
                }
                String str2 = "00";
                if (iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                } else {
                    str2 = "" + iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = iceStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 2) {
                String str0 = "2";
                String str1 = "00";
                for (int i = 0; i < Meridians_Str.length; i++) {
                    if (fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridians_Str[i][2])) {
                        str1 = Meridians_Str[i][1];
                        break;
                    }
                }
                if (Integer.parseInt(str1) == 0) {
                    isLearnMer = true;
                    str1 = "01";
                    for (int i = 0; i < Meridianslearn_Str.length; i++) {
                        if (fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                            str1 = Meridianslearn_Str[i][1];
                        }
                    }
                }
                String str2 = "00";
                if (fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = fireStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 3) {
                String str0 = "3";
                String str1 = "00";
                for (int i = 0; i < Meridians_Str.length; i++) {
                    if (poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridians_Str[i][2])) {
                        str1 = Meridians_Str[i][1];
                        break;
                    }
                }
                if (Integer.parseInt(str1) == 0) {
                    isLearnMer = true;
                    str1 = "01";
                    for (int i = 0; i < Meridianslearn_Str.length; i++) {
                        if (poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                            str1 = Meridianslearn_Str[i][1];
                        }
                    }
                }
                String str2 = "00";
                if (poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = poisonStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            }
            Tools.printLog("getMeridiansKey    " + getMeridiansKey);
            Tools.printLog("getMeridiansLevel    " + getMeridiansLevel);
            Tools.printLog("getMeridiansName    " + getMeridiansName);
            if (isLearnMer) {
                Tools.printLog("不可以学习此经脉00    ");
            } else {
                Tools.printLog("可以学习此经脉哈哈00    ");
            }
        } else {//描述
            if (meridianschoose_index == 0) {
                String str0 = "0";
                String str1 = "00";
                for (int i = 0; i < Meridianslearn_Str.length; i++) {
                    if (basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                        str1 = Meridianslearn_Str[i][1];
                    }
                }
                String str2 = "00";
                if (basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + basicMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = basicStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 1) {
                String str0 = "1";
                String str1 = "00";
                for (int i = 0; i < Meridianslearn_Str.length; i++) {
                    if (iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                        str1 = Meridianslearn_Str[i][1];
                    }
                }
                String str2 = "00";
                if (iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                } else {
                    str2 = "" + iceMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = iceStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 2) {
                String str0 = "2";
                String str1 = "00";
                for (int i = 0; i < Meridianslearn_Str.length; i++) {
                    if (fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                        str1 = Meridianslearn_Str[i][1];
                    }
                }
                String str2 = "00";
                if (fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + fireMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = fireStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            } else if (meridianschoose_index == 3) {
                String str0 = "3";
                String str1 = "00";
                for (int i = 0; i < Meridianslearn_Str.length; i++) {
                    if (poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] == Integer.parseInt(Meridianslearn_Str[i][2])) {
                        str1 = Meridianslearn_Str[i][1];
                    }
                }
                String str2 = "00";
                if (poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum] < 10) {
                    str2 = "0" + poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];

                } else {
                    str2 = "" + poisonMeridians[(meridians_index - 1)][meridiansOperation_index + startNum];
                }
                getMeridiansKey = str0 + str1 + str2;
                getMeridiansLevel = str1;
                getMeridiansName = poisonStr[(meridians_index - 1)][meridiansOperation_index + startNum];
            }
            Tools.printLog("getMeridiansKey  描述    " + getMeridiansKey);
            Tools.printLog("getMeridiansLevel  描述    " + getMeridiansLevel);
            Tools.printLog("getMeridiansName  描述   " + getMeridiansName);
//            if (isLearnMer) {
//                Tools.printLog("不可以学习此经脉11    ");
//            } else {
//                Tools.printLog("可以学习此经脉哈哈11    ");
//            }
        }

    }
    public String[] meridianDesc;

    public void getmeridianDesc(int needpoints, String description, int nextneedpoints, String nextdescription) {
        meridianDesc = new String[4];
        meridianDesc[0] = "" + needpoints;
        meridianDesc[1] = description;
        meridianDesc[2] = "" + nextneedpoints;
        meridianDesc[3] = nextdescription;
    }
    public static int meridians_index;
    public static int meridiansOperation_index;
    public static int MaxOperation_index;
    public static int meridianschoose_index;
    public static int startNum;
//    public boolean ISmeridiansOperation;

    private void meridiansOperation() {
        int num = 0;
        int startnum = 0;
        boolean start = false;
        if (meridianschoose_index == 0) {
            for (int i = 0; i < basicMeridians[(meridians_index - 1)].length; i++) {
                if (basicMeridians[(meridians_index - 1)][i] != 0) {
                    num += 1;
                    if (!start) {
                        startnum = i;
                        start = true;
                    }
                }
            }
        } else if (meridianschoose_index == 1) {
            for (int i = 0; i < iceMeridians[(meridians_index - 1)].length; i++) {
                if (iceMeridians[(meridians_index - 1)][i] != 0) {
                    num += 1;
                    if (!start) {
                        startnum = i;
                        start = true;
                    }
                }
            }
        } else if (meridianschoose_index == 2) {
            for (int i = 0; i < fireMeridians[(meridians_index - 1)].length; i++) {
                if (fireMeridians[(meridians_index - 1)][i] != 0) {
                    num += 1;
                    if (!start) {
                        startnum = i;
                        start = true;
                    }
                }
            }
        } else if (meridianschoose_index == 3) {
            for (int i = 0; i < poisonMeridians[(meridians_index - 1)].length; i++) {
                if (poisonMeridians[(meridians_index - 1)][i] != 0) {
                    num += 1;
                    if (!start) {
                        startnum = i;
                        start = true;
                    }
                }
            }
        }
        MaxOperation_index = num;
        startNum = startnum;
    }
    private static int lengthNum;

    public void getMeridiansLength() {
        int num = 0;
        if (meridianschoose_index == 0) {
            num = basicMeridians.length;
        } else if (meridianschoose_index == 1) {
            num = iceMeridians.length;
        } else if (meridianschoose_index == 2) {
            num = fireMeridians.length;
        } else if (meridianschoose_index == 3) {
            num = poisonMeridians.length;
        }
        lengthNum = num;
    }
    public static int M_index;
    public int cursorCenterOffsetX;
    private static byte meridians_operationTyte;
    private final byte meridians_interface = 0;
    private final byte meridians_operation = 1;
    private final byte meridians_view = 2;
    private final byte meridians_learn = 3;
    private String[] meridians_operationStr;
    private static int meroperation_index;

    public void updateMeridians() {
        cursorCenterOffsetX = (Tools.sin(M_index << Tools.BITS + 4) >> Tools.BITS - 2);
//        if (!ISmeridiansOperation) {
        switch (meridians_operationTyte) {
            case meridians_interface:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    meridians_index = meridians_index < lengthNum ? (meridians_index + 1) : 0;
                    meridiansOperation_index = 0;
                    MaxOperation_index = 0;
                    startNum = 0;
                    if (meridians_index > 0) {
                        meridiansOperation();
                    }
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    meridians_index = meridians_index > 0 ? (meridians_index - 1) : lengthNum;
                    meridiansOperation_index = 0;
                    MaxOperation_index = 0;
                    startNum = 0;
                    if (meridians_index > 0) {
                        meridiansOperation();
                    }
                }
                if (meridians_index > 0) {
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                        meridiansOperation_index = meridiansOperation_index < (MaxOperation_index - 1) ? (meridiansOperation_index + 1) : 0;
//            getMeridiansKey(1);
//            MainLogic.getInstance().send(Constant.MSG_NET_GET_MERIDIAN_DESC, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                        meridiansOperation_index = meridiansOperation_index > 0 ? (meridiansOperation_index - 1) : (MaxOperation_index - 1);
//            getMeridiansKey(1);
//            MainLogic.getInstance().send(Constant.MSG_NET_GET_MERIDIAN_DESC, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                }

                if (meridians_index == 0) {
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                        meridianschoose_index = meridianschoose_index < 3 ? (meridianschoose_index + 1) : 0;
                        getMeridiansLength();
                        meridians_index = 0;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_MERIDIAN, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                    if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                        meridianschoose_index = meridianschoose_index > 0 ? (meridianschoose_index - 1) : 3;
                        getMeridiansLength();
                        meridians_index = 0;
                        MainLogic.getInstance().send(Constant.MSG_NET_CMD_OPEN_MERIDIAN, Constant.SOCKET_MSG_TYPE_LOGIC);
                    }
                }
                if (meridians_index > 0
                        && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
                    getMeridiansKey(1);
                    MainLogic.getInstance().send(Constant.MSG_NET_GET_MERIDIAN_DESC, Constant.SOCKET_MSG_TYPE_LOGIC);
                    meridians_operationTyte = meridians_operation;
                    getMeridiansKey(0);
                    meroperation_index = 0;
                    if (!isLearnMer) {
                        meridians_operationStr = new String[]{"查看", "学习"};
                    } else {
                        meridians_operationStr = new String[]{"查看",};
                    }
//            ISmeridiansOperation = true;
//            meridiansOperation_index = 0;
//            MaxOperation_index = 0;
//            startNum = 0;
//            meridiansOperation();
//            getMeridiansKey(1);
//            MainLogic.getInstance().send(Constant.MSG_NET_GET_MERIDIAN_DESC, Constant.SOCKET_MSG_TYPE_LOGIC);
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                    Tools.openRoamMenu(false, (byte) 1, (byte) 3, 2);
                }
                break;
            case meridians_operation:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                    meroperation_index = meroperation_index < (meridians_operationStr.length - 1) ? (meroperation_index + 1) : 0;
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                    meroperation_index = meroperation_index > 0 ? (meroperation_index - 1) : (meridians_operationStr.length - 1);
                }
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                    meridians_operationTyte = meridians_interface;
                }
                if (meroperation_index == 0
                        && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
                    getMeridiansKey(1);
                    MainLogic.getInstance().send(Constant.MSG_NET_GET_MERIDIAN_DESC, Constant.SOCKET_MSG_TYPE_LOGIC);
                    meridians_operationTyte = meridians_view;
                }
                if (meroperation_index == 1
                        && (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false))) {
                    getMeridiansKey(0);
                    if (!meridianDesc[3].equals("")) {
                        if (!isLearnMer) {
                            if (playerPoints >= Integer.parseInt(meridianDesc[2])) {
                                MainLogic.getInstance().send(Constant.MSG_NET_LEARN_MERIDIAN, Constant.SOCKET_MSG_TYPE_LOGIC);
                            } else {
                                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "修为值不足!");
                                getMeridiansKey(1);
                            }
                        } else {
                            MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "等级不足或前置经脉未开启!");
                            getMeridiansKey(1);
                        }
                    } else {
                        MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "已经是当前最高等级!");
                        getMeridiansKey(1);
                    }
                    meridians_operationTyte = meridians_interface;
                }
                break;
            case meridians_view:
                if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                        || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {//返回
                    meridians_operationTyte = meridians_interface;
                }
                break;
        }
    }
    /**
     * 经脉系统结束
     */
    /**
     * 世界地图开始
     */
    private String[] mapWorld_Name;
    private String[][] mapWorldsend;
    private int[][] mapWorldPic_coordinates;

    public void drawMapWorld(Graphics g) {
        if (this.imgArray[0] != null) {
            //#if NOKIA_S60V5
             g.drawImage(this.imgArray[1], Constant.UI_START_X, Constant.UI_START_Y, 0);
             for (int i = 0; i < mapWorldPic_coordinates.length; i++) {
                 g.setColor(0xffffff);
                 g.fillArc(mapWorldPic_coordinates[i][0], mapWorldPic_coordinates[i][1], 12, 12, 0, 360);
                 g.setColor(0x00E7FF);
                 g.fillArc(mapWorldPic_coordinates[i][0] + 2, mapWorldPic_coordinates[i][1] + 2, 8, 8, 0, 360);
             }
             //绘制选择
             g.drawRegion(this.imgArray[3], 0, 0, this.imgArray[3].getWidth(), this.imgArray[3].getHeight(),
                     Constant.TRANS_MIRROR,
                     mapWorldPic_coordinates[mapworld_index][0] - 3,
                     mapWorldPic_coordinates[mapworld_index][1] - this.imgArray[3].getHeight() - cursorCenterOffsetX,
                     0);
             //绘制确定返回
             Tools.drawBottom(g, imgArray[6], imgArray[4], imgArray[5]);
 //            Tools.drawShadowString(g, (byte) 1, mapArray[0], Constant.UI_START_X + 5,
 //                    Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight()
 //                    - (this.imgArray[5].getHeight() - Constant.FONT_SMALL.getHeight()) / 2, 0x000000, 0x00E7FF);
 //            Tools.drawShadowString(g, (byte) 1, mapArray[1], Constant.UI_START_X + (Constant.SCREEN_WIDTH
 //                    - Constant.FONT_SMALL.stringWidth(mapArray[1])) - 5,
 //                    Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight()
 //                    - (this.imgArray[5].getHeight() - Constant.FONT_SMALL.getHeight()) / 2, 0x000000, 0x00E7FF);
             Tools.drawShadowString(g, (byte) 1, mapWorld_Name[mapworld_index],
                     (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(mapWorld_Name[mapworld_index])) / 2,
                     Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight() - 5
                     - this.imgArray[5].getHeight(), 0x00E7FF, 0x000000);
 //            Tools.drawTilePic(g, (byte) 1, 0,
 //                    Constant.SCREEN_HEIGHT - this.imgArray[0].getHeight(),
 //                    Constant.SCREEN_WIDTH, this.imgArray[0],
 //                    0, 0,
 //                    this.imgArray[0].getWidth(), this.imgArray[0].getHeight(), Constant.TRANS_ROT180);
 //            g.setColor(0x000000);
 //            g.drawLine(0, Constant.SCREEN_HEIGHT - this.imgArray[0].getHeight(),
 //                    Constant.SCREEN_WIDTH, Constant.SCREEN_HEIGHT - this.imgArray[0].getHeight());
            //#else
            //#if NOKIA_E72
//#             g.drawImage(this.imgArray[1], Constant.UI_START_X + 40, Constant.UI_START_Y + UiInterFace.iScreenOffsetH, 0);
//#             Tools.drawTilePic(g, (byte) 2, 0,
//#                     0,
//#                     Constant.SCREEN_HEIGHT, this.imgArray[4],
//#                     0, 0,
//#                     this.imgArray[4].getWidth(), this.imgArray[4].getHeight(), Constant.TRANS_NONE);
//#             Tools.drawTilePic(g, (byte) 2, Constant.SCREEN_WIDTH - 40,
//#                     0,
//#                     Constant.SCREEN_HEIGHT, this.imgArray[4],
//#                     0, 0,
//#                     this.imgArray[4].getWidth(), this.imgArray[4].getHeight(), Constant.TRANS_NONE);
            //#else
//#            g.drawImage(this.imgArray[1], Constant.UI_START_X, Constant.UI_START_Y, 0);
            //#endif
//#            for (int i = 0; i < mapWorldPic_coordinates.length; i++) {
//#                g.setColor(0xffffff);
//#                g.fillArc(mapWorldPic_coordinates[i][0], mapWorldPic_coordinates[i][1] + UiInterFace.iScreenOffsetH, 12, 12, 0, 360);
//#                g.setColor(0x00E7FF);
//#                g.fillArc(mapWorldPic_coordinates[i][0] + 2, mapWorldPic_coordinates[i][1] + 2 + UiInterFace.iScreenOffsetH, 8, 8, 0, 360);
//#            }
//#            //绘制选择
//#            g.drawRegion(this.imgArray[3], 0, 0, this.imgArray[3].getWidth(), this.imgArray[3].getHeight(),
//#                    Constant.TRANS_MIRROR,
//#                    mapWorldPic_coordinates[mapworld_index][0] - 3,
//#                    mapWorldPic_coordinates[mapworld_index][1] - this.imgArray[3].getHeight() - cursorCenterOffsetX + UiInterFace.iScreenOffsetH,
//#                    0);
//#            //绘制确定返回
//#            Tools.drawShadowString(g, (byte) 1, mapArray[0], Constant.UI_START_X + 5,
//#                    Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight()
//#                    - (this.imgArray[0].getHeight() - Constant.FONT_SMALL.getHeight()) / 2, 0x000000, 0x00E7FF);
//#            Tools.drawShadowString(g, (byte) 1, mapArray[1], Constant.UI_START_X + (Constant.SCREEN_WIDTH
//#                    - Constant.FONT_SMALL.stringWidth(mapArray[1])) - 5,
//#                    Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight()
//#                    - (this.imgArray[0].getHeight() - Constant.FONT_SMALL.getHeight()) / 2, 0x000000, 0x00E7FF);
//#            Tools.drawShadowString(g, (byte) 1, mapWorld_Name[mapworld_index],
//#                    (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(mapWorld_Name[mapworld_index])) / 2,
//#                    Constant.SCREEN_HEIGHT - Constant.FONT_SMALL.getHeight()
//#                    - (this.imgArray[0].getHeight() - Constant.FONT_SMALL.getHeight()) / 2, 0x00E7FF, 0x000000);
            //#if NOKIA_E72
//#             Tools.drawE72ScrollBar(g);
            //#else
//#            Tools.drawSelectMask(g, (byte) 2, this.imgArray[0], Constant.UI_START_X, Constant.SCREEN_HEIGHT - 23, Constant.SCREEN_WIDTH);
            //#endif
            //#endif
        }
        M_index++;
    }
    public void checkTouchMapWorld(int x, int y) {
        Integer key = new Integer(MainLogic.getInstance().byGameState); 
		int[][]touchrect = (int[][]) MainCanvas.s_uiTouch.get(key);
		if (touchrect == null) {
			touchrect = new int[][]{
					{36-30, 314-30,72,72},//轩辕村
	                {76-30, 254-30,72,72},//北岸森林
	                {150-30, 150-30,72,72},//北疆高原
	                {213-30, 253-30,72,72},//丰饶平原
	                {220-30, 311-30,72,72},//天翔城
	                {138-30, 322-30,72,72},//绝望沼泽
	                {202-30, 451-30,72,72},//咸水村
	                {298-30, 376-30,72,72},//晨风村
			};
			MainCanvas.putHash(Constant.GAME_UI_MAP_WORLD, touchrect);
		}
		UiEquipment uiEquipment = MainLogic.getInstance().uiEquipment;
		if (uiEquipment != null) {
			int touched = MainCanvas.checkTouch(x, y, touchrect);
			if (touched >= 0) {
				uiEquipment.mapworld_index = touched;
			}
		}
		MainCanvas.checkSoftKey();
		
	}
    public void clearWorld() {
        this.imgArray = null;
        this.mapWorld_Name = null;
        this.mapWorldsend = null;
        this.mapWorldPic_coordinates = null;
        this.mapArray = null;
        //#if NOKIA_E72
//#         Tools.clearE72ScollBar();
        //#endif
    }
    public static int mapworld_index;

    public void updateMapWorld() {
        cursorCenterOffsetX = (Tools.sin(M_index << Tools.BITS + 4) >> Tools.BITS - 2);
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            mapworld_index = mapworld_index < (mapWorld_Name.length - 1) ? (mapworld_index + 1) : 0;
            //#if NOKIA_E72
//#             if (mapWorldPic_coordinates[mapworld_index][1] == 205) {
//#                 Tools.updateE72ScollBar(-60);
//#             } else if (mapWorldPic_coordinates[mapworld_index][1] > 205) {
//#                 Tools.updateE72ScollBar(-80);
//#             } else {
//#                 Tools.updateE72ScollBar(0);
//#             }
            //#endif
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            mapworld_index = mapworld_index > 0 ? (mapworld_index - 1) : (mapWorld_Name.length - 1);
            //#if NOKIA_E72
//#             if (mapWorldPic_coordinates[mapworld_index][1] == 205) {
//#                 Tools.updateE72ScollBar(-60);
//#             } else if (mapWorldPic_coordinates[mapworld_index][1] > 205) {
//#                 Tools.updateE72ScollBar(-80);
//#             } else {
//#                 Tools.updateE72ScollBar(0);
//#             }
            //#endif
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false) || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
            if (!MainLogic.getInstance().uiInterFace.sRoamMapKeys.equals("10601")) {//10601
                GameBean.STR_SCENCE_KEY = mapWorldsend[mapworld_index][0];
                GameBean.i_SEND_POS_X = Integer.parseInt(mapWorldsend[mapworld_index][1]);
                GameBean.i_SEND_POS_Y = Integer.parseInt(mapWorldsend[mapworld_index][2]);
                Tools.printLog("GameBean.STR_SCENCE_KEY, GameBean.i_SEND_POS_X , GameBean.i_SEND_POS_X=" + GameBean.STR_SCENCE_KEY + "|" + GameBean.i_SEND_POS_X + "|" + GameBean.i_SEND_POS_Y + "|");
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_FUNC_SEND, Constant.SOCKET_MSG_TYPE_LOGIC);
            } else {
                MainLogic.getInstance().uiInterFace.sysMessage.showMessage("提示", "此区域不能使用传送功能!");
            }
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {//返回
            //#if NOKIA_E72
//#             Tools.updateE72ScollBar(0);
            //#endif
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {//返回
            //#if NOKIA_E72
//#             Tools.updateE72ScollBar(-80);
            //#endif
        } else if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            Tools.openRoamMenu(false, (byte) 1, (byte) 0, 7);
        }
    }
    /**
     * 世界地图结束
     */
    /**
     * 获得公告列表
     */
    public String[][] noticListtype_1, noticListtype_2;//新闻，活动
    public int Listtype1_index, Listtype2_index;
//    public String[][] noticListtype_1 = {
//        {"1104360374274", "1", "2", "0", "公告1"},
//        {"1104360374274", "1", "2", "0", "公告2"},
//        {"1104360374274", "1", "2", "0", "公告3一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "2", "0", "公告4一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "2", "0", "公告5"},
//        {"1104360374274", "1", "2", "0", "公告6"},
//        //        {"1104360374274", "1", "2", "0", "公告7一二三四五六七八九十一二三一二三一二三一二三"},
//        //        {"1104360374274", "1", "2", "0", "公告8"},
//        //        {"1104360374274", "1", "2", "0", "公告9"},
//        //        {"1104360374274", "1", "2", "0", "公告10"},
//        {"", "", "", "", ""},};
//    public String[][] noticListtype_2 = {
//        {"1104360374274", "1", "1", "0", "公告21一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告22一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告23一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告24一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告25"},
//        {"1104360374274", "1", "1", "0", "公告26一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告27"},
//        {"1104360374274", "1", "1", "0", "公告28一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告29一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告210一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告211一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告212一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告213一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告214一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告215一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告216一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告217一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告218一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告219一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告220一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告221一二三四五六七八九十一二三一二三一二三一二三"},
//        {"1104360374274", "1", "1", "0", "公告222一二三四五六七八九十一二三一二三一二三一二三"},
//        {"", "", "", "", ""},};

    public void getNoticeList(long Notice_id, byte Place, byte noticeType, byte Notice_order, String noticeTitle) {
        if (noticeType == 1) {
            noticListtype_1[Listtype1_index][0] = "" + Notice_id;
            noticListtype_1[Listtype1_index][1] = "" + Place;
            noticListtype_1[Listtype1_index][2] = "" + noticeType;
            noticListtype_1[Listtype1_index][3] = "" + Notice_order;
            noticListtype_1[Listtype1_index][4] = noticeTitle;
            Listtype1_index++;
            noticListtype_1 = resizeArraynoticList(noticListtype_1);
        } else {
            noticListtype_2[Listtype2_index][0] = "" + Notice_id;
            noticListtype_2[Listtype2_index][1] = "" + Place;
            noticListtype_2[Listtype2_index][2] = "" + noticeType;
            noticListtype_2[Listtype2_index][3] = "" + Notice_order;
            noticListtype_2[Listtype2_index][4] = noticeTitle;
            Listtype2_index++;
            noticListtype_2 = resizeArraynoticList(noticListtype_2);
        }
    }
    //改变数组大小

    public String[][] resizeArraynoticList(String[][] array) {
        int len = array.length;
        String[][] tmp = array;
        array = new String[len + 1][5];
        for (int i = 0; i < len; i++) {
            System.arraycopy(tmp[i], 0, array[i], 0, 5);
        }
        return array;
    }
    public static int noticeListchoose_index;
    public static int noticelist_index, noticelist_linenum;

    public void drawNoticeList(Graphics g) {
        //#if NOKIA_S60V5
         Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                 this.imgArray[6], this.imgArray[4], this.imgArray[5], "更多公告");
         int start_Y = 41;
         int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(sArray[0]) * 2) / 3;
         for (int i = 0; i < 2; i++) {
             Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * i,
                     start_Y,
                     noticeListchoose_index == i ? 0x00E7FF : 0xffffff, 0x000000);
         }
         g.setColor(0x000000);
         g.drawLine(0, start_Y + 2 + Constant.FONT_SMALL.getHeight(),
                 Constant.SCREEN_WIDTH, start_Y + 2 + Constant.FONT_SMALL.getHeight());
         Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                 str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * noticeListchoose_index + cursorCenterOffsetX,
                 start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
         Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                 str_interval + Constant.FONT_SMALL.stringWidth(sArray[0]) + 5
                 + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * noticeListchoose_index - cursorCenterOffsetX,
                 start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
         int font_H = Constant.FONT_SMALL.getHeight();
         int H = (Constant.NEW_END_LINE - start_Y - font_H * 9) / 7;
         if (noticelist_index < 9) {
             for (int i = 0; i < noticelist_linenum; i++) {
                 //绘制发件人
                 if (i < 8) {
                     Tools.drawShadowString(g, (byte) 1, shortenStr(noticeListchoose_index == 0 ? noticListtype_1[i][4] : noticListtype_2[i][4],
                             Constant.SCREEN_WIDTH - 10),
                             5, start_Y + font_H + (font_H + H) * i,
                             0xffffff, 0x000000);
                 }
             }
         } else {
             for (int i = 0; i < 8; i++) {
                 //绘制发件人
                 Tools.drawShadowString(g, (byte) 1,
                         shortenStr(noticeListchoose_index == 0 ? noticListtype_1[i + noticelist_index - 8][4]
                         : noticListtype_2[i + noticelist_index - 8][4],
                         Constant.SCREEN_WIDTH - 10),
                         5, start_Y + font_H + (font_H + H) * i,
                         0xffffff, 0x000000);
             }
         }
         //绘制选择对话
         if (noticelist_index > 0) {
             if (noticelist_index < 9) {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         Constant.UI_START_Y + start_Y + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (noticelist_index - 1),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (noticelist_index - 1),
                         Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (noticelist_index - 1));
                 Tools.drawTilePic(g, (byte) 1, 0,
                         Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
                 g.setColor(0x000000);
                 g.drawLine(0, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1),
                         Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1));
             } else {
                 Tools.drawTilePic(g, (byte) 1, 0,
                         Constant.UI_START_Y + start_Y + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (7),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
                 g.setColor(0x000000);
                 g.drawLine(0, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (7),
                         Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H - 1 + (font_H + H) * (7));
                 Tools.drawTilePic(g, (byte) 1, 0,
                         Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7),
                         Constant.SCREEN_WIDTH, this.imgArray[1],
                         0, 0,
                         this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
                 g.setColor(0x000000);
                 g.drawLine(0, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7),
                         Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + font_H + font_H + 1 + (font_H + H) * (7));
             }
 
         }
        //#else
//#        Tools.drawFrame(g,
//#                Constant.UI_START_X, Constant.UI_START_Y,
//#                this.imgArray[2],
//#                this.imgArray[0],
//#                this.imgArray[1],
//#                this.imgArray[3],
//#                0, 0, 24, 12,
//#                this.imgArray[3], 49, 0, 23, 12,
//#                "更多公告", 0xFFFFFF);
//#        int start_Y = 21;
//#        int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(sArray[0]) * 2) / 3;
//#        for (int i = 0; i < 2; i++) {
//#            Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * i,
//#                    start_Y,
//#                    noticeListchoose_index == i ? 0x00E7FF : 0xffffff, 0x000000);
//#        }
//#        g.setColor(0x000000);
//#        g.drawLine(0, start_Y + 2 + Constant.FONT_SMALL.getHeight(),
//#                Constant.SCREEN_WIDTH, start_Y + 2 + Constant.FONT_SMALL.getHeight());
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * noticeListchoose_index + cursorCenterOffsetX,
//#                start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                str_interval + Constant.FONT_SMALL.stringWidth(sArray[0]) + 5
//#                + (str_interval + Constant.FONT_SMALL.stringWidth(sArray[0])) * noticeListchoose_index - cursorCenterOffsetX,
//#                start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#        int font_H = Constant.FONT_SMALL.getHeight();
//#        int H = (Constant.SCREEN_HEIGHT - start_Y - 2 - font_H * 9) / 7;
//#        if (noticelist_index < 9) {
//#            for (int i = 0; i < noticelist_linenum; i++) {
//#                //绘制发件人
//#                if (i < 8) {
//#                    Tools.drawShadowString(g, (byte) 1, shortenStr(noticeListchoose_index == 0 ? noticListtype_1[i][4] : noticListtype_2[i][4],
//#                            Constant.SCREEN_WIDTH - 10),
//#                            5, start_Y + 2 + font_H + (font_H + H) * i,
//#                            0xffffff, 0x000000);
//#                }
//#            }
//#        } else {
//#            for (int i = 0; i < 8; i++) {
//#                //绘制发件人
//#                Tools.drawShadowString(g, (byte) 1,
//#                        shortenStr(noticeListchoose_index == 0 ? noticListtype_1[i + noticelist_index - 8][4]
//#                        : noticListtype_2[i + noticelist_index - 8][4],
//#                        Constant.SCREEN_WIDTH - 10),
//#                        5, start_Y + 2 + font_H + (font_H + H) * i,
//#                        0xffffff, 0x000000);
//#            }
//#        }
//#        //绘制选择对话
//#        if (noticelist_index > 0) {
//#            if (noticelist_index < 9) {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        Constant.UI_START_Y + start_Y + 2 + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (noticelist_index - 1),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, Constant.UI_START_Y + start_Y + 2 + font_H - 1 + (font_H + H) * (noticelist_index - 1),
//#                        Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + 2 + font_H - 1 + (font_H + H) * (noticelist_index - 1));
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
//#                g.setColor(0x000000);
//#                g.drawLine(0, Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1),
//#                        Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (noticelist_index - 1));
//#            } else {
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        Constant.UI_START_Y + start_Y + 2 + font_H - 1 - this.imgArray[1].getHeight() + (font_H + H) * (7),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#                g.setColor(0x000000);
//#                g.drawLine(0, Constant.UI_START_Y + start_Y + 2 + font_H - 1 + (font_H + H) * (7),
//#                        Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + 2 + font_H - 1 + (font_H + H) * (7));
//#                Tools.drawTilePic(g, (byte) 1, 0,
//#                        Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (7),
//#                        Constant.SCREEN_WIDTH, this.imgArray[1],
//#                        0, 0,
//#                        this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_ROT180);
//#                g.setColor(0x000000);
//#                g.drawLine(0, Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (7),
//#                        Constant.SCREEN_WIDTH, Constant.UI_START_Y + start_Y + 2 + font_H + font_H + 1 + (font_H + H) * (7));
//#            }
//#
//#        }
        //#endif
        M_index++;
    }
    public long Noticeid;
    public static byte NoticeListState;

    public void updateNoticeList() {
        cursorCenterOffsetX = (Tools.sin(M_index << Tools.BITS + 4) >> Tools.BITS - 2);
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
            noticeListchoose_index = noticeListchoose_index < 1 ? (noticeListchoose_index + 1) : 0;
            noticelist_index = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
            noticeListchoose_index = noticeListchoose_index > 0 ? (noticeListchoose_index - 1) : 1;
            noticelist_index = 0;
        }
        if (noticeListchoose_index == 0) {
            noticelist_linenum = noticListtype_1.length - 1;
        } else {
            noticelist_linenum = noticListtype_2.length - 1;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            noticelist_index = noticelist_index < noticelist_linenum ? (noticelist_index + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            noticelist_index = noticelist_index > 0 ? (noticelist_index - 1) : noticelist_linenum;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
            if (noticelist_index > 0) {
//                System.out.println("11   ::: "+(noticeListchoose_index == 0 ? noticListtype_1[noticelist_index-1][0]
//                        : noticListtype_2[noticelist_index-1][0]));
                Noticeid = Long.parseLong(noticeListchoose_index == 0 ? noticListtype_1[noticelist_index - 1][0]
                        : noticListtype_2[noticelist_index - 1][0]);
                NoticeListState = 1;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_CMD_NOTICE, Constant.SOCKET_MSG_TYPE_LOGIC);

            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, true);
            MainLogic.getInstance().bCanStartGuide = true;
        }
    }

    public void clearNoticeList() {
        this.imgArray = null;
        this.sArray = null;
    }

    /**
     * 获得公告列表结束
     */
    /**
     * 断线重连
     * @param g
     */
    public void drawConnecAgain(Graphics g) {
        //#if NOKIA_S60V5
         Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                 this.imgArray[6], this.imgArray[4], this.imgArray[5], "重新连接");
         int start_Y = 41;
        //#else
//#        Tools.drawFrame(g,
//#                Constant.UI_START_X, Constant.UI_START_Y,
//#                this.imgArray[2],
//#                this.imgArray[0],
//#                this.imgArray[1],
//#                this.imgArray[3],
//#                0, 0, 24, 12,
//#                this.imgArray[3], 49, 0, 23, 12,
//#                "重新连接", 0xFFFFFF);
//#        int start_Y = 21;
        //#endif
        for (int i = 0; i < sArray.length; i++) {
            Tools.drawShadowString(g, (byte) 1, sArray[i], (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(sArray[i])) / 2,
                    start_Y + 2 + (Constant.FONT_SMALL.getHeight() + 2) * i,
                    0xffffff, 0x000000);
        }

    }

    public void updateConnecAgain() {
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
            NetManager.getInstance().closeConnect();
            NetManager.getNewInstance().startNetManager();
            Constant.spacetime = System.currentTimeMillis();
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            //MainLogic.getInstance().pushState(Constant.GAME_UI_OPTION_LIST, true);
            MainLogic.getInstance().exitGame();
        }
    }

    public void clearConnecAgain() {
        this.imgArray = null;
        this.sArray = null;
    }

    /**
     * 游戏设置
     */
    public void drawGameset(Graphics g) {
        //#if NOKIA_S60V5
         Tools.drawS60V5Frame(g, this.imgArray[2], this.imgArray[7],
                 this.imgArray[6], this.imgArray[4], this.imgArray[5], this.gamesetArray[0]);
         int start_Y = 41;
 //        String[] str = {"系统", "聊天", "显示"};
         int font_H = Constant.FONT_SMALL.getHeight();
         int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) * 3) / 4;
         for (int i = 0; i < 3; i++) {
             Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[1])) * i,
                     start_Y,
                     gameset_index == i ? 0x00E7FF : 0xffffff, 0x000000);
         }
         int interval_H = (Constant.NEW_END_LINE - start_Y - Constant.FONT_SMALL.getHeight() * 11) / 12;
         if (gameset_index == 0) {
             for (int i = 0; i < gameset_system.length; i++) {
                 Tools.drawShadowString(g, (byte) 1, gameset_system[i], 5,
                         start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                         0xffffff, 0x000000);
                 if (i < 5) {
                     Tools.drawShadowString(g, (byte) 1, isopenset[i] == true ? gamesetArray[2] : gamesetArray[3],
                             Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5,
                             start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                             0xffffff, 0x000000);
                 } else {
                     if (i >= 5 && i < 8) {
                         Tools.drawShadowString(g, (byte) 1,
                                 isopenset[i + 15] == true ? gamesetArray[2] : gamesetArray[3],
                                 Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5,
                                 start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                                 0xffffff, 0x000000);
                     } else if (i == 8) {
                         String[] strflow = {"高", "中", "低"};
                         Tools.drawShadowString(g, (byte) 1,
                                 strflow[flow],
                                 Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5,
                                 start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                                 0xffffff, 0x000000);
                     }
 
                 }
             }
         }
         if (gameset_index == 1) {
             for (int i = 0; i < gameset_chat.length; i++) {
                 Tools.drawShadowString(g, (byte) 1, gameset_chat[i], 5,
                         start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                         0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, isopenset[i + 5] == true ? gamesetArray[2] : gamesetArray[3],
                         Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5,
                         start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                         0xffffff, 0x000000);
             }
         }
         if (gameset_index == 2) {
             for (int i = 0; i < gameset_display.length; i++) {
                 Tools.drawShadowString(g, (byte) 1, gameset_display[i], 5,
                         start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                         0xffffff, 0x000000);
                 Tools.drawShadowString(g, (byte) 1, isopenset[i + 10] == true ? gamesetArray[2] : gamesetArray[3],
                         Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5,
                         start_Y + font_H + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
                         0xffffff, 0x000000);
             }
         }
         Tools.drawArrow(g, this.imgArray[0], (byte) 1,
                 str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4])) * gameset_index + cursorCenterOffsetX,
                 start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
         Tools.drawArrow(g, this.imgArray[0], (byte) 2,
                 str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4]) + 5
                 + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4])) * gameset_index - cursorCenterOffsetX,
                 start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
         Tools.drawTilePic(g, (byte) 1, 0,
                 start_Y + font_H - this.imgArray[1].getHeight(),
                 Constant.SCREEN_WIDTH, this.imgArray[1],
                 0, 0,
                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
         g.setColor(0x000000);
         g.drawLine(0, start_Y + font_H,
                 Constant.SCREEN_WIDTH, start_Y + font_H);
 
         //绘制选择
 //        int upward_H = (this.imgArray[1].getHeight() - Constant.FONT_SMALL.getHeight()) / 2;
         Tools.drawTilePic(g, (byte) 1, 0,
                 start_Y + font_H + interval_H
                 + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index + font_H - this.imgArray[1].getHeight(),
                 Constant.SCREEN_WIDTH, this.imgArray[1],
                 0, 0,
                 this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
         g.setColor(0x000000);
         g.drawLine(0, start_Y + font_H + interval_H
                 + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index + font_H,
                 Constant.SCREEN_WIDTH, start_Y + font_H + interval_H
                 + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index + font_H);
        //#else
        //#if NOKIA_E72
//#         Tools.drawE72Frame(g, this.imgArray[2], this.imgArray[3], gamesetArray[0]);
//#         int Start_x = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth("显示区域聊天开")) / 3;
        //#else
//#        Tools.drawFrame(g,
//#                Constant.UI_START_X, Constant.UI_START_Y,
//#                this.imgArray[2],
//#                this.imgArray[0],
//#                this.imgArray[1],
//#                this.imgArray[3],
//#                0, 0, 24, 12,
//#                this.imgArray[3], 49, 0, 23, 12,
//#                gamesetArray[0], 0xFFFFFF);
//#        int Start_x = 0;
        //#endif
//#        int start_Y = 21;
//#        int str_interval = (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) * 3) / 4;
//#        for (int i = 0; i < 3; i++) {
//#            Tools.drawShadowString(g, (byte) 1, sArray[i], str_interval + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[1])) * i,
//#                    start_Y,
//#                    gameset_index == i ? 0x00E7FF : 0xffffff, 0x000000);
//#        }
//#        int interval_H = (Constant.SCREEN_HEIGHT - start_Y - this.imgArray[1].getHeight() - 25 - Constant.FONT_SMALL.getHeight() * 10) / 11;
//#        if (gameset_index == 0) {
//#            for (int i = 0; i < gameset_system.length; i++) {
//#                Tools.drawShadowString(g, (byte) 1, gameset_system[i], 5 + Start_x,
//#                        start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                        0xffffff, 0x000000);
//#                if (i < 5) {
//#                    Tools.drawShadowString(g, (byte) 1, isopenset[i] == true ? gamesetArray[2] : gamesetArray[3],
//#                            Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5 - Start_x,
//#                            start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                            0xffffff, 0x000000);
//#                } else {
//#                    if (i >= 5 && i < 8) {
//#                        Tools.drawShadowString(g, (byte) 1,
//#                                isopenset[i + 15] == true ? gamesetArray[2] : gamesetArray[3],
//#                                Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5 - Start_x,
//#                                start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                                0xffffff, 0x000000);
//#                    } else if (i == 8) {
//#                        String[] strflow = {"高", "中", "低"};
//#                        Tools.drawShadowString(g, (byte) 1,
//#                                strflow[flow],
//#                                Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5 - Start_x,
//#                                start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                                0xffffff, 0x000000);
//#                    }
//#
//#                }
//#            }
//#        }
//#        if (gameset_index == 1) {
//#            for (int i = 0; i < gameset_chat.length; i++) {
//#                Tools.drawShadowString(g, (byte) 1, gameset_chat[i], 5 + Start_x,
//#                        start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                        0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, isopenset[i + 5] == true ? gamesetArray[2] : gamesetArray[3],
//#                        Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5 - Start_x,
//#                        start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                        0xffffff, 0x000000);
//#            }
//#        }
//#        if (gameset_index == 2) {
//#            for (int i = 0; i < gameset_display.length; i++) {
//#                Tools.drawShadowString(g, (byte) 1, gameset_display[i], 5 + Start_x,
//#                        start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                        0xffffff, 0x000000);
//#                Tools.drawShadowString(g, (byte) 1, isopenset[i + 10] == true ? gamesetArray[2] : gamesetArray[3],
//#                        Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(gamesetArray[1]) - 5 - Start_x,
//#                        start_Y + this.imgArray[1].getHeight() + interval_H + (Constant.FONT_SMALL.getHeight() + interval_H) * i,
//#                        0xffffff, 0x000000);
//#            }
//#        }
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 1,
//#                str_interval - 10 + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4])) * gameset_index + cursorCenterOffsetX,
//#                start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#        Tools.drawArrow(g, this.imgArray[0], (byte) 2,
//#                str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4]) + 5
//#                + (str_interval + Constant.FONT_SMALL.stringWidth(gamesetArray[4])) * gameset_index - cursorCenterOffsetX,
//#                start_Y + (Constant.FONT_SMALL.getHeight() - 7) / 2);
//#        Tools.drawTilePic(g, (byte) 1, 0,
//#                start_Y,
//#                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                0, 0,
//#                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#        g.setColor(0x000000);
//#        g.drawLine(0, start_Y + this.imgArray[1].getHeight(),
//#                Constant.SCREEN_WIDTH, start_Y + this.imgArray[1].getHeight());
//#
//#        //绘制选择
//#        int upward_H = (this.imgArray[1].getHeight() - Constant.FONT_SMALL.getHeight()) / 2;
//#        Tools.drawTilePic(g, (byte) 1, 0,
//#                start_Y + this.imgArray[1].getHeight() + interval_H
//#                + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index - upward_H,
//#                Constant.SCREEN_WIDTH, this.imgArray[1],
//#                0, 0,
//#                this.imgArray[1].getWidth(), this.imgArray[1].getHeight(), Constant.TRANS_NONE);
//#        g.setColor(0x000000);
//#        g.drawLine(0, start_Y + this.imgArray[1].getHeight() + interval_H
//#                + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index + this.imgArray[1].getHeight() - upward_H,
//#                Constant.SCREEN_WIDTH, start_Y + this.imgArray[1].getHeight() + interval_H
//#                + (Constant.FONT_SMALL.getHeight() + interval_H) * set_index + this.imgArray[1].getHeight() - upward_H);
        //#endif
        M_index++;
        
        
        MainView.drawTouchRect(g, mGamesetTouchRect);
        MainView.drawTouchRect(g, mGamesetItemTouchRect);
    }

    public void initchatSet() {
        chatSet[2] = isopenset[6] == true ? 0 : 1;//显示区域聊天
        chatSet[4] = isopenset[7] == true ? 0 : 1;//显示队伍聊天
        chatSet[5] = isopenset[8] == true ? 0 : 1;//显示帮派聊天
        chatSet[6] = isopenset[9] == true ? 0 : 1;//显示系统消息
    }
    private String[] gameset_system;
    private String[] gameset_chat;
    private String[] gameset_display;

    public void updateGameset() {
        cursorCenterOffsetX = (Tools.sin(M_index << Tools.BITS + 4) >> Tools.BITS - 2);
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
            gameset_index = gameset_index < 2 ? (gameset_index + 1) : 0;
            set_index = 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
            gameset_index = gameset_index > 0 ? (gameset_index - 1) : 2;
            set_index = 0;
        }
        int set_indexlength = 0;
        if (gameset_index == 0) {
            set_indexlength = gameset_system.length - 1;
        } else if (gameset_index == 1) {
            set_indexlength = gameset_chat.length - 1;
        } else if (gameset_index == 2) {
            set_indexlength = gameset_display.length - 1;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
            set_index = set_index < set_indexlength ? (set_index + 1) : 0;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
            set_index = set_index > 0 ? (set_index - 1) : set_indexlength;
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)
                || MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)) {
            if (gameset_index == 0) {
                if (set_index < 5) {
                    isopenset[set_index] = isopenset[set_index] == false ? true : false;
                } else {
                    if (set_index >= 5 && set_index < 8) {
                        isopenset[set_index + 15] = isopenset[set_index + 15] == false ? true : false;
                    } else if (set_index == 8) {
                        flow = (byte) (flow < 2 ? (flow + 1) : 0);
                    }

                }
                if (!isopenset[22]) {
                    SkillManager.iSkillShakeNums = 0;
                    SkillManager.iSkillFalshNums = 0;
                }
                if (set_index == 0) {
                    //#if NOKIAN73 || NOKIA_S40V3  || MOT0 || K790
                    //#else
                    if (!isopenset[0]) {
                        UiInterFace.SetPlayMusic = false;
                        SoundPlayerUtil.stopAllMusic();
                    } else {
                        if (UiInterFace.isOpenSound) {
                            SoundPlayerUtil.stopAllMusic();
                            UiInterFace.SetPlayMusic = true;
                            UiInterFace.firstUiMusic = true;
                            if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1060")) {
                                SoundPlayerUtil.playmusic(1);
                            } else if (MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1020")
                                    || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1030")
                                    || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1040")
                                    || MainLogic.getInstance().uiInterFace.sRoamMapKeys.substring(0, 4).equals("1050")) {
                                SoundPlayerUtil.playmusic(2);
                            } else {
                                SoundPlayerUtil.playmusic(0);
                            }

                        }
                    }
                    //#endif
                }

            } else if (gameset_index == 1) {
                isopenset[set_index + 5] = isopenset[set_index + 5] == false ? true : false;
            } else if (gameset_index == 2) {
                isopenset[set_index + 10] = isopenset[set_index + 10] == false ? true : false;
            }
        }
        if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
            Tools.openRoamMenu(false, (byte) 1, (byte) 9, 2);
            Rms.saveGame(Constant.RMS_GAME_DRAW_SET, null);
            if (MainLogic.uiEquipment.isopenset[18]) {
                MainLogic.getInstance().uiInterFace.byWeatherType = MainLogic.getInstance().uiInterFace.getScenceWeatherType(MainLogic.getInstance().uiInterFace.sRoamMapKeys);
                MainLogic.getInstance().uiInterFace.initWeather();
            }
            MainLogic.getInstance().send(Constant.MSG_NET_CMD_SET_FLOW, Constant.SOCKET_MSG_TYPE_LOGIC);
            initchatSet();
//            if (MainLogic.getInstance().uiEquipment.isopenset[18]) {
//                MainLogic.getInstance().uiInterFace.initSnow();
//                MainLogic.getInstance().uiInterFace.initSunshine();
//                MainLogic.getInstance().uiInterFace.initPetals();
//                MainLogic.getInstance().uiInterFace.initRain();
//                MainLogic.getInstance().uiInterFace.initCloud();
//            }
        }
    }

    public void clearGameset() {
        this.imgArray = null;
        gameset_system = null;
        gameset_chat = null;
        gameset_display = null;
        sArray = null;
        gamesetArray = null;
    }
    //兑换EXCHANGE
    public static String[][] Exchange;
    public static int Exchangenum, Exchange_index;
    public int Exchange_h = 5, ExchangeRect_h, EdescriptionRect_h = 130;
    public boolean isExchangedescription;
    public static int Exchange_num;

    public void getExchange(int index, String sShopTitle, String sGoodsKey, String sGoodsName, String shLevel,
            String description, String type) {
        Exchange[index][0] = sShopTitle;
        Exchange[index][1] = sGoodsKey;
        Exchange[index][2] = sGoodsName;
        Exchange[index][3] = shLevel;
        Exchange[index][4] = description;
        Exchange[index][5] = type;
    }

    public void drawExchange(Graphics g) {
        if (!isExchangedescription) {
            if (!Exchange[0][0].equals("")) {
                Tools.drawPopUp(g, (byte) 4, (Constant.SCREEN_WIDTH - 200) / 2, (Constant.SCREEN_HEIGHT - ExchangeRect_h) / 2,
                        200, ExchangeRect_h, imgArray[0], imgArray[1],
                        (byte) 1, null, 0, 0, 22, 10, null, 22, 0, 21, 10,
                        Exchange[0][0], "");
                for (int i = 0; i < Exchangenum; i++) {
                    Tools.drawShadowString(g, (byte) 1, Exchange[i][2],
                            (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(Exchange[i][2])) / 2,
                            (Constant.SCREEN_HEIGHT - ExchangeRect_h) / 2 + 12
                            + Constant.FONT_SMALL.getHeight() + (Constant.FONT_SMALL.getHeight() + Exchange_h) * i,
                            0xffffff, 0x333333);
                }
                Tools.drawShadowString(g, (byte) 1, "确定", Constant.UI_START_X + 5,
                        (Constant.SCREEN_HEIGHT - ExchangeRect_h) / 2 + 12
                        + Constant.FONT_SMALL.getHeight() + (Constant.FONT_SMALL.getHeight() + Exchange_h) * Exchange_index, 0x333333, 0x00E7FF);
                Tools.drawShadowString(g, (byte) 1, "返回",
                        Constant.UI_START_X + Constant.SCREEN_WIDTH - 5 - Constant.FONT_SMALL.stringWidth("返回"),
                        (Constant.SCREEN_HEIGHT - ExchangeRect_h) / 2 + 12
                        + Constant.FONT_SMALL.getHeight() + (Constant.FONT_SMALL.getHeight() + Exchange_h) * Exchange_index, 0x333333, 0x00E7FF);
                Tools.drawSelectMask(g, (byte) 1, this.imgArray[2], 0,
                        (Constant.SCREEN_HEIGHT - ExchangeRect_h) / 2 + 12
                        + Constant.FONT_SMALL.getHeight() * 2 + (Constant.FONT_SMALL.getHeight() + Exchange_h) * Exchange_index,
                        Constant.DRAW_WIDTH);
            }
        } else {
            Tools.drawPopUp(g, (byte) 4, (Constant.SCREEN_WIDTH - 200) / 2, (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2,
                    200, EdescriptionRect_h, imgArray[0], imgArray[3],
                    (byte) 1, null, 0, 0, 22, 10, null, 22, 0, 21, 10,
                    "描述", "");
            Tools.drawParagraph(g, (Constant.SCREEN_WIDTH - 200) / 2 + 5,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + 12
                    + Constant.FONT_SMALL.getHeight(),
                    200 - 10,
                    Exchange[Exchange_index][4], 0x000000, Constant.FONT_SMALL.getHeight(), -1);
//            Exchange_num
            Tools.drawShadowString(g, (byte) 1, "兑换" + Exchange_num + "个", (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(("兑换" + Exchange_num + "个"))) / 2,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight() - 5, 0x333333, 0x00E7FF);
            Tools.drawArrow(g, this.imgArray[4], (byte) 1,
                    (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(("兑换" + Exchange_num + "个"))) / 2 - 15 + cursorCenterOffsetX,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight() - 5 + (Constant.FONT_SMALL.getHeight() - 7) / 2);
            Tools.drawArrow(g, this.imgArray[04], (byte) 2,
                    (Constant.SCREEN_WIDTH - Constant.FONT_SMALL.stringWidth(("兑换" + Exchange_num + "个"))) / 2
                    + Constant.FONT_SMALL.stringWidth(("兑换" + Exchange_num + "个")) + 10 - cursorCenterOffsetX,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight() - 5 + (Constant.FONT_SMALL.getHeight() - 7) / 2);
            Tools.drawShadowString(g, (byte) 1, "兑换", Constant.UI_START_X + 5,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight(), 0x333333, 0x00E7FF);
            Tools.drawShadowString(g, (byte) 1, "返回",
                    Constant.UI_START_X + Constant.SCREEN_WIDTH - 5 - Constant.FONT_SMALL.stringWidth("返回"),
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight(), 0x333333, 0x00E7FF);
            Tools.drawSelectMask(g, (byte) 1, this.imgArray[2], 0,
                    (Constant.SCREEN_HEIGHT - EdescriptionRect_h) / 2 + EdescriptionRect_h - Constant.FONT_SMALL.getHeight()
                    + Constant.FONT_SMALL.getHeight(),
                    Constant.DRAW_WIDTH);
            M_index++;
        }
    }

    public void updateExchange() {
        if (GameBean.b_WAIT_NET_MSG_BACK) {
            return;
        }

        if (!isExchangedescription) {
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_DOWN, false)) {
                Exchange_index = Exchange_index < (Exchangenum - 1) ? (Exchange_index + 1) : 0;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_UP, false)) {
                Exchange_index = Exchange_index > 0 ? (Exchange_index - 1) : (Exchangenum - 1);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定
                isExchangedescription = true;
                Exchange_num = 1;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                MainLogic.getInstance().pushState(Constant.GAME_UI_ROAM, false);
            }
        } else {
            cursorCenterOffsetX = (Tools.sin(M_index << Tools.BITS + 4) >> Tools.BITS - 2);
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_RIGHT, false)) {
                Exchange_num = Exchange_num < 10 ? (Exchange_num + 1) : 1;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_LEFT, false)) {
                Exchange_num = Exchange_num > 1 ? (Exchange_num - 1) : 10;
            }
            if (Exchange_num < 1) {
                Exchange_num = 1;
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_POSITIVE, false)
                    || MainCanvas.keyPressedLogic(Constant.GAME_KEY_FIRE, false)) {//确定
                GameBean.BY_TYPE = 1;
                GameBean.BY_OP_TYPE = Byte.parseByte(Exchange[Exchange_index][5]);
                GameBean.STR_CDM_GOODS_KEY = Exchange[Exchange_index][1];
                GameBean.BY_GOODS_NUM = (byte) Exchange_num;
                GameBean.b_WAIT_NET_MSG_BACK = true;
                MainLogic.getInstance().send(Constant.MSG_NET_CMD_FUNC_STORE, Constant.SOCKET_MSG_TYPE_LOGIC);
            }
            if (MainCanvas.keyPressedLogic(Constant.GAME_KEY_NEGATIVE, false)) {//返回
                isExchangedescription = false;
            }
        }

    }

    public void clearExchange() {
        this.imgArray = null;
    }

    /////////////////////
    public static int[][] mGameChatTouchRect = new int[][]{
    	{5,30,50,30},
    	{55,30,50,30},
    	{105,30,50,30},
    	{155,30,50,30},
    	{205,30,50,30},
    	{255,30,50,30},
    	{305,30,50,30}
    	
    };
    
    public static int[][] mGameChatUpDownTouchRect = new int[][]{
    	{0,70,360,250},
    	{0,320,360,250},
    };
    
    public void checkTouchGameChat(int x, int y)
    {
    	 int touched = MainCanvas.checkTouch(x, y, mGameChatTouchRect);
    	 if(touched>=0)
    	 {
    		 chatSelectindex = touched;
    		 set_index = 0;
    	 }
    	 else
    	 {
    		 MainCanvas.checkSoftKey();
    	 }
    }
    
    
    public static int[][] mGamesetTouchRect = new int[][]{
    	{30,30,100,30},
    	{130,30,100,30},
    	{230,30,100,30},
    	
    };
    public static int[][] mGamesetItemTouchRect;
    
    public void setGamesetItemTouchRect()
    {
    	int count = 0;
    	int startY = 65;
    	if(gameset_index == 0)
    		count = 9;
    	else if(gameset_index == 1)
    		count = 5;
    	else if(gameset_index == 2)
    		count = 10;
    	mGamesetItemTouchRect = new int[count][];
    	for(int i = 0; i < count; i++)
    	{
    		mGamesetItemTouchRect[i] = new int[]{
    			0,startY + i * 30,360,30
    		};
    	}
    	
    }
    
    public void checkTouchGameset(int x, int y)
    {
    	 int touched = MainCanvas.checkTouch(x, y, mGamesetTouchRect);
    	 if(touched>=0)
    	 {
    		 gameset_index = touched;
    		 set_index = 0;
    		 setGamesetItemTouchRect();
    	 }
    	 else
    	 {
    		 if(mGamesetItemTouchRect != null)
    		 {
    			 touched = MainCanvas.checkTouch(x, y, mGamesetItemTouchRect);
    			 if(touched >= 0)
    			 {
    				 set_index = touched;
    				 MainCanvas.pressFire();
    			 }
    			 else
        		 {
        			 MainCanvas.checkSoftKey();
        		 }
    		 }
    		 else
    		 {
    			 MainCanvas.checkSoftKey();
    		 }
    	 }
    }
    //////////////////////
    //
    public static int[][] mReceiveEmailPageTouchRect =  new int[][]{
    	{128,600,50,30},{190,600,50,30},
    };
    public static int[][] mReceiveEmailTouchRect =  null;
    public void setReceiveEmailTouchRect()
    {
    	if(num_email <= 0)
    		return;
    	mReceiveEmailTouchRect = new int[num_email][];
    	for(int i = 0; i < num_email; i++)
    	{
    		mReceiveEmailTouchRect[i] = new int[]{
    				0,60 + 23 * i,360,23
    		};
    	}
    	
    }
    
    public void checkTouchReceiveEmail(int x, int y)
    {
    	if(mReceiveEmailTouchRect != null)
    	{
    		int touched = MainCanvas.checkTouch(x, y, mReceiveEmailTouchRect);
    		if(touched >= 0)
    		{
//    			if(ReceiveEmail_index == touched)
    			
    			ReceiveEmail_index = touched;
    			MainCanvas.pressFire();
    		}
    		else
	   		 {
	   			 
	   			 MainCanvas.checkSoftKey();
	   		 }
    	}
    	 else
		 {
    		 int touched = MainCanvas.checkTouch(x, y, mReceiveEmailPageTouchRect);
    		 if(touched >= 0)
    		 {
    			 if(touched == 0)
    			 {
    				 if(Receive_CurrentPage > 0)
    				 {
    					 Receive_CurrentPage--; 
    					 ReceiveEmail_index = 0;
    				 }
    			}
    			 else
    			 {
    				 if(Receive_CurrentPage < Receive_TotalPage -1)
    				 {
    					 Receive_CurrentPage++;
    					ReceiveEmail_index = 0;
    				 }
    				 
    			 }
    			
    		 }
    		 else
    		 {
    			 
    			 MainCanvas.checkSoftKey();
    		 }
		 }
    }
    
    /////////////////
    //
    public static int[][] mOperationEmailTouchRect =  new int[][]{
    	
    	
    };
    public void checkTouchOperationEmail(int x, int y)
    {
        
    }
  
    ///////////////
    //
    public static int[][] mSendEmailGoodsTouchRect = new int[][]{
    	{64,176,40,40},{112,176,40,40},{157,176,40,40},{202,176,40,40},{248,176,40,40},
    	{64,224,40,40},{112,224,40,40},{157,224,40,40},{202,224,40,40},{248,224,40,40}
    };
    public static int[][] mSendEmailTouchRect =  new int[][]{
    	//Top
    	{0,40,180,20},{180,40,180,20},
    	//收件人,标题,正文
    	{0,66,360,20},
    	{0,87,360,20},
    	{0,109,360,20},
    	//金币
    	{0,317,360,20},
    	//附件
    	{76,340,40,40},{123,340,40,40},{167,340,40,40},{212,340,40,40}
    };
    public void checkTouchSendEmail(int x, int y)
    {
    	if(!addgoods)
    	{
	    	 int touched = MainCanvas.checkTouch(x, y, mSendEmailTouchRect);
	    	 if(touched>=0)
	    	 {
	    		 if(touched == 0)
	    		 {
	    			 sendORlist_index = 0;
	    			 sendEmail_index = 0;
	    			 MainCanvas.pressFire();
	    			 
	    		 }
	    		 else if(touched == 1)
	    		 {
	    			 sendORlist_index = 1;
	    			 sendEmail_index = 0;
	    			 MainCanvas.pressFire();
	    		 }
	    		 else if(touched > 1 && touched < 5)
	    		 {
	    			 sendEmail_index = touched - 1;
	    			 sendORlist_index = 0;
	    			 MainCanvas.pressFire();
	    		 }
	    		 else if(touched == 5)
	    		 {
	    			 sendEmail_index = 4;
	    			 sendORlist_index = 0;
	    			 MainCanvas.pressFire();
	    		 }
	    		 else if(touched > 5 && touched < 10)
	    		 {
	    			 sendORlist_index = 0;
	    			 addgoods = true;
	    		 }
	    	 }
	    	 else
			 {
				 
				 MainCanvas.checkSoftKey();
			 }
    	}
    	
    	else
    	{
    		int touched = MainCanvas.checkTouch(x, y, mSendEmailGoodsTouchRect);
	    	 if(touched>=0)
	    	 {
	    		 addgoods_index = touched;
	    		 MainCanvas.pressFire();
	    	 }
	    	 else
			 {
				 
				 MainCanvas.checkSoftKey();
			 }
    		
    	}
    }
    
    
    
    
    
    /////////////////
    //
    public static int[][] mViewEmailTouchRect =  new int[][]{
    	//Top
    	{0,40,180,20},{180,40,180,20}
    };
    public void checkTouchViewEmail(int x, int y)
    {
    	 int touched = MainCanvas.checkTouch(x, y, mViewEmailTouchRect);
    	 if(touched >= 0)
    	 {
    		 
    		 viewEmailoperation_index = touched;
    		 if(touched == 0)
    		 {
    			 MainCanvas.pressFire();
    		 }
    		 else
    		 {
	    		 operationmail_index = ReceiveEmail_index + Receive_CurrentPage * num_email;
	             MainLogic.getInstance().uiEquipment.Opeartion_type = 4;
	             GameBean.b_WAIT_NET_MSG_BACK = true;
	             MainLogic.getInstance().send(Constant.MSG_NET_CMD_MAIL_OPEARTION, Constant.SOCKET_MSG_TYPE_LOGIC);
	             Tools.printLog("删除邮件111");
    		 }
    	 }
    	 else
    	 {
    		 MainCanvas.checkSoftKey();
    	 }
    	
    }
	
}
